audrey/src/window.blp

218 lines
4.4 KiB
Text
Raw Normal View History

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
}
}
};
}
}
[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",
]
2024-10-12 12:28:05 +00:00
Picture {
paintable: bind template.playing_cover_art;
2024-10-10 10:12:43 +00:00
}
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
}
Box {
halign: start;
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-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
}
}
}
Separator {
styles [
"spacer",
]
hexpand: true;
}
Button {
icon-name: "media-skip-backward";
valign: center;
}
Button {
icon-name: "media-playback-start";
valign: center;
2024-10-12 12:28:05 +00:00
clicked => $on_play_pause_clicked ();
2024-10-10 10:12:43 +00:00
}
Button {
icon-name: "media-skip-forward";
valign: center;
}
Button {
icon-name: "non-starred";
valign: center;
}
2024-10-11 06:57:01 +00:00
Button mute {
2024-10-10 10:12:43 +00:00
icon-name: "audio-volume-high";
valign: center;
}
Scale {
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
};
}
}
};
}