2024-10-10 10:12:43 +00:00
|
|
|
using Gtk 4.0;
|
|
|
|
using Adw 1;
|
|
|
|
|
|
|
|
template $WaveletWindow: Adw.ApplicationWindow {
|
|
|
|
title: _("Wavelet");
|
|
|
|
default-width: 800;
|
|
|
|
default-height: 600;
|
|
|
|
|
|
|
|
content: Box {
|
|
|
|
orientation: vertical;
|
|
|
|
|
|
|
|
Adw.OverlaySplitView {
|
|
|
|
vexpand: true;
|
|
|
|
|
|
|
|
[sidebar]
|
|
|
|
Adw.NavigationPage {
|
|
|
|
width-request: 100;
|
|
|
|
title: _("Wavelet");
|
|
|
|
|
|
|
|
Adw.ToolbarView {
|
|
|
|
[top]
|
|
|
|
Adw.HeaderBar {}
|
|
|
|
|
|
|
|
content: Box {
|
|
|
|
orientation: vertical;
|
|
|
|
|
|
|
|
ListBox sidebar {
|
|
|
|
styles [
|
|
|
|
"navigation-sidebar",
|
|
|
|
]
|
|
|
|
|
2024-10-11 08:22:05 +00:00
|
|
|
row-activated => $on_sidebar_row_activated();
|
|
|
|
|
2024-10-10 10:12:43 +00:00
|
|
|
ListBoxRow sidebar_setup {
|
|
|
|
Label {
|
|
|
|
xalign: 0;
|
2024-10-10 10:16:23 +00:00
|
|
|
label: _("Setup");
|
2024-10-10 10:12:43 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
ListBoxRow sidebar_play_queue {
|
|
|
|
Label {
|
|
|
|
xalign: 0;
|
2024-10-10 10:16:23 +00:00
|
|
|
label: _("Play queue");
|
2024-10-10 10:12:43 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Separator {}
|
|
|
|
|
|
|
|
ListBox {
|
|
|
|
selection-mode: none;
|
|
|
|
|
|
|
|
styles [
|
|
|
|
"navigation-sidebar",
|
|
|
|
]
|
|
|
|
|
2024-10-10 10:51:12 +00:00
|
|
|
Adw.ButtonRow shuffle_all_tracks {
|
2024-10-10 10:16:23 +00:00
|
|
|
title: _("Shuffle all tracks");
|
2024-10-10 10:12:43 +00:00
|
|
|
start-icon-name: "media-playlist-shuffle";
|
2024-10-10 10:51:12 +00:00
|
|
|
sensitive: false;
|
2024-10-10 10:12:43 +00:00
|
|
|
}
|
|
|
|
}
|
2024-10-12 18:08:20 +00:00
|
|
|
|
|
|
|
Separator {
|
|
|
|
styles [
|
|
|
|
"spacer",
|
|
|
|
]
|
|
|
|
vexpand: true;
|
|
|
|
}
|
|
|
|
|
|
|
|
Picture {
|
|
|
|
paintable: bind template.playing_cover_art;
|
|
|
|
}
|
2024-10-10 10:12:43 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
[content]
|
|
|
|
Stack stack {
|
|
|
|
StackPage {
|
|
|
|
name: "setup";
|
2024-10-10 10:16:23 +00:00
|
|
|
title: _("Setup");
|
2024-10-10 10:12:43 +00:00
|
|
|
|
|
|
|
child: $WaveletSetup setup {};
|
|
|
|
}
|
|
|
|
|
|
|
|
StackPage {
|
|
|
|
name: "play_queue";
|
2024-10-10 10:16:23 +00:00
|
|
|
title: _("Play queue");
|
2024-10-10 10:12:43 +00:00
|
|
|
|
|
|
|
child: $WaveletPlayQueue play_queue {};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
[bottom]
|
|
|
|
Box {
|
|
|
|
orientation: horizontal;
|
|
|
|
|
|
|
|
styles [
|
|
|
|
"toolbar",
|
|
|
|
]
|
|
|
|
|
|
|
|
Box {
|
|
|
|
orientation: vertical;
|
|
|
|
valign: center;
|
|
|
|
|
|
|
|
Label {
|
2024-10-11 07:53:30 +00:00
|
|
|
styles [ "caption-heading" ]
|
2024-10-10 10:12:43 +00:00
|
|
|
halign: start;
|
2024-10-11 07:53:30 +00:00
|
|
|
label: bind template.song as <$WaveletSong>.title;
|
2024-10-10 10:12:43 +00:00
|
|
|
}
|
|
|
|
|
2024-10-11 07:53:30 +00:00
|
|
|
Box {
|
2024-10-10 10:12:43 +00:00
|
|
|
halign: start;
|
2024-10-11 07:53:30 +00:00
|
|
|
Label {
|
|
|
|
styles [ "caption" ]
|
|
|
|
label: bind template.song as <$WaveletSong>.artist;
|
|
|
|
}
|
|
|
|
Label {
|
|
|
|
styles [ "caption" ]
|
|
|
|
label: " - ";
|
|
|
|
}
|
|
|
|
Label {
|
|
|
|
styles [ "caption" ]
|
|
|
|
label: bind template.song as <$WaveletSong>.album;
|
|
|
|
}
|
|
|
|
Label {
|
|
|
|
styles [ "caption" ]
|
|
|
|
label: " - ";
|
|
|
|
}
|
|
|
|
Label {
|
|
|
|
styles [ "caption" ]
|
|
|
|
label: bind template.song as <$WaveletSong>.year;
|
|
|
|
}
|
2024-10-10 10:12:43 +00:00
|
|
|
}
|
2024-10-12 18:13:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
Separator {
|
|
|
|
styles [
|
|
|
|
"spacer",
|
|
|
|
]
|
|
|
|
|
|
|
|
hexpand: true;
|
|
|
|
}
|
|
|
|
|
|
|
|
Box {
|
|
|
|
orientation: vertical;
|
2024-10-10 10:12:43 +00:00
|
|
|
|
|
|
|
Box {
|
2024-10-12 18:13:22 +00:00
|
|
|
halign: center;
|
2024-10-10 10:12:43 +00:00
|
|
|
orientation: horizontal;
|
|
|
|
|
2024-10-11 06:57:01 +00:00
|
|
|
Label play_position_label {
|
|
|
|
styles [
|
2024-10-11 07:53:30 +00:00
|
|
|
"caption",
|
2024-10-11 06:57:01 +00:00
|
|
|
"numeric",
|
|
|
|
]
|
|
|
|
|
2024-10-12 12:28:05 +00:00
|
|
|
label: bind $format_timestamp (template.position) as <string>;
|
2024-10-10 10:12:43 +00:00
|
|
|
}
|
|
|
|
|
2024-10-11 06:57:01 +00:00
|
|
|
Scale play_position {
|
2024-10-12 18:41:03 +00:00
|
|
|
name: "seek-scale";
|
2024-10-10 10:12:43 +00:00
|
|
|
orientation: horizontal;
|
|
|
|
width-request: 200;
|
|
|
|
|
|
|
|
adjustment: Adjustment {
|
|
|
|
lower: 0;
|
2024-10-12 12:28:05 +00:00
|
|
|
value: bind template.position;
|
|
|
|
upper: bind template.playbin as <$Playbin>.duration;
|
2024-10-10 10:12:43 +00:00
|
|
|
};
|
2024-10-12 12:28:05 +00:00
|
|
|
|
|
|
|
change-value => $on_play_position_seek ();
|
2024-10-10 10:12:43 +00:00
|
|
|
}
|
|
|
|
|
2024-10-11 06:57:01 +00:00
|
|
|
Label play_duration {
|
|
|
|
styles [
|
2024-10-11 07:53:30 +00:00
|
|
|
"caption",
|
2024-10-11 06:57:01 +00:00
|
|
|
"numeric",
|
|
|
|
]
|
|
|
|
|
2024-10-12 12:28:05 +00:00
|
|
|
label: bind $format_timestamp (template.playbin as <$Playbin>.duration) as <string>;
|
2024-10-10 10:12:43 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-10-12 18:13:22 +00:00
|
|
|
Box {
|
|
|
|
halign: center;
|
|
|
|
orientation: horizontal;
|
2024-10-10 10:12:43 +00:00
|
|
|
|
2024-10-12 18:13:22 +00:00
|
|
|
Button {
|
|
|
|
icon-name: "media-skip-backward";
|
|
|
|
valign: center;
|
2024-10-10 10:12:43 +00:00
|
|
|
|
2024-10-12 18:13:22 +00:00
|
|
|
clicked => $on_skip_backward_clicked ();
|
|
|
|
}
|
2024-10-12 13:36:47 +00:00
|
|
|
|
2024-10-12 18:13:22 +00:00
|
|
|
Button {
|
|
|
|
icon-name: "media-seek-backward";
|
|
|
|
valign: center;
|
|
|
|
}
|
2024-10-10 10:12:43 +00:00
|
|
|
|
2024-10-12 18:13:22 +00:00
|
|
|
Button {
|
|
|
|
icon-name: bind $play_button_icon_name (template.playing) as <string>;
|
|
|
|
valign: center;
|
2024-10-12 12:28:05 +00:00
|
|
|
|
2024-10-12 18:13:22 +00:00
|
|
|
clicked => $on_play_pause_clicked ();
|
|
|
|
}
|
2024-10-10 10:12:43 +00:00
|
|
|
|
2024-10-12 18:13:22 +00:00
|
|
|
Button {
|
|
|
|
icon-name: "media-seek-forward";
|
|
|
|
valign: center;
|
|
|
|
}
|
|
|
|
|
|
|
|
Button {
|
|
|
|
icon-name: "media-skip-forward";
|
|
|
|
valign: center;
|
2024-10-12 13:36:47 +00:00
|
|
|
|
2024-10-12 18:13:22 +00:00
|
|
|
clicked => $on_skip_forward_clicked ();
|
|
|
|
}
|
|
|
|
}
|
2024-10-10 10:12:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
Button {
|
|
|
|
icon-name: "non-starred";
|
|
|
|
valign: center;
|
|
|
|
}
|
|
|
|
|
2024-10-12 16:35:42 +00:00
|
|
|
Button {
|
|
|
|
icon-name: bind $mute_button_icon_name (template.mute) as <string>;
|
2024-10-10 10:12:43 +00:00
|
|
|
valign: center;
|
2024-10-12 16:35:42 +00:00
|
|
|
|
|
|
|
clicked => $on_mute_toggle ();
|
2024-10-10 10:12:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
Scale {
|
2024-10-12 18:44:10 +00:00
|
|
|
name: "volume-scale";
|
2024-10-10 10:12:43 +00:00
|
|
|
orientation: horizontal;
|
|
|
|
width-request: 130;
|
|
|
|
|
|
|
|
adjustment: Adjustment {
|
2024-10-11 06:57:01 +00:00
|
|
|
lower: 0.0;
|
|
|
|
value: bind template.volume bidirectional;
|
|
|
|
upper: 1.0;
|
2024-10-10 10:12:43 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|