2024-10-19 15:04:56 +00:00
|
|
|
using Gtk 4.0;
|
2024-10-28 08:52:50 +00:00
|
|
|
using Adw 1;
|
2024-10-19 15:04:56 +00:00
|
|
|
|
2024-10-29 14:46:33 +00:00
|
|
|
template $AudreyUiPlaybar: Adw.Bin {
|
2024-10-28 08:52:50 +00:00
|
|
|
child: CenterBox {
|
2024-10-20 10:03:24 +00:00
|
|
|
hexpand: true;
|
2024-11-05 08:29:08 +00:00
|
|
|
|
2024-10-28 08:52:50 +00:00
|
|
|
styles [
|
|
|
|
"toolbar",
|
|
|
|
]
|
2024-10-20 10:03:24 +00:00
|
|
|
|
2024-10-19 15:04:56 +00:00
|
|
|
[start]
|
|
|
|
Box {
|
2024-10-20 16:25:40 +00:00
|
|
|
AspectFrame {
|
|
|
|
visible: false; // FIXME annoying annoying annoying annoying
|
2024-11-05 08:29:08 +00:00
|
|
|
// visible: bind template.show_cover_art;
|
2024-10-20 16:25:40 +00:00
|
|
|
vexpand: true;
|
|
|
|
ratio: 1.0;
|
|
|
|
obey-child: false;
|
|
|
|
|
|
|
|
child: Picture {
|
|
|
|
content-fit: scale_down;
|
|
|
|
paintable: bind template.playing_cover_art;
|
|
|
|
};
|
2024-10-19 15:04:56 +00:00
|
|
|
}
|
|
|
|
|
2024-10-20 15:28:47 +00:00
|
|
|
Box {
|
|
|
|
margin-start: 6;
|
|
|
|
orientation: vertical;
|
|
|
|
valign: center;
|
|
|
|
|
|
|
|
Label {
|
2024-11-05 08:29:08 +00:00
|
|
|
styles [
|
|
|
|
"heading"
|
|
|
|
]
|
|
|
|
|
2024-10-20 15:28:47 +00:00
|
|
|
xalign: 0;
|
|
|
|
halign: start;
|
2024-11-05 09:01:07 +00:00
|
|
|
label: bind template.song as <$AudreyPlaybinSong>.title;
|
2024-10-20 15:28:47 +00:00
|
|
|
ellipsize: end;
|
|
|
|
}
|
|
|
|
|
|
|
|
Label {
|
2024-11-05 08:29:08 +00:00
|
|
|
styles [
|
|
|
|
"caption"
|
|
|
|
]
|
|
|
|
|
2024-10-20 15:28:47 +00:00
|
|
|
xalign: 0;
|
2024-11-05 09:01:07 +00:00
|
|
|
label: bind template.song as <$AudreyPlaybinSong>.artist;
|
2024-10-20 15:28:47 +00:00
|
|
|
ellipsize: end;
|
|
|
|
}
|
2024-10-19 15:04:56 +00:00
|
|
|
|
2024-10-20 15:28:47 +00:00
|
|
|
Label {
|
2024-11-05 08:29:08 +00:00
|
|
|
styles [
|
|
|
|
"caption"
|
|
|
|
]
|
|
|
|
|
2024-10-20 15:28:47 +00:00
|
|
|
xalign: 0;
|
2024-11-05 09:01:07 +00:00
|
|
|
label: bind template.song as <$AudreyPlaybinSong>.album;
|
2024-10-20 15:28:47 +00:00
|
|
|
ellipsize: end;
|
|
|
|
}
|
2024-10-19 15:04:56 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
[center]
|
|
|
|
Box {
|
|
|
|
orientation: vertical;
|
2024-10-20 16:25:40 +00:00
|
|
|
valign: center;
|
2024-10-19 15:04:56 +00:00
|
|
|
|
|
|
|
CenterBox {
|
|
|
|
[start]
|
|
|
|
Label play_position_label {
|
|
|
|
styles [
|
|
|
|
"caption",
|
|
|
|
"numeric",
|
|
|
|
]
|
|
|
|
|
2024-11-05 08:29:08 +00:00
|
|
|
label: bind $format_timestamp(template.position) as <string>;
|
2024-10-19 15:04:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
[center]
|
|
|
|
Scale play_position {
|
|
|
|
name: "seek-scale";
|
|
|
|
orientation: horizontal;
|
|
|
|
width-request: 400;
|
2024-11-05 09:01:07 +00:00
|
|
|
sensitive: bind template.idle-active inverted;
|
2024-10-19 15:04:56 +00:00
|
|
|
adjustment: Adjustment {
|
|
|
|
lower: 0;
|
2024-11-03 18:25:32 +00:00
|
|
|
value: bind template.position;
|
|
|
|
upper: bind template.duration;
|
2024-10-19 15:04:56 +00:00
|
|
|
};
|
|
|
|
|
2024-11-05 08:29:08 +00:00
|
|
|
change-value => $on_play_position_seek() swapped;
|
2024-10-19 15:04:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
[end]
|
|
|
|
Label play_duration {
|
|
|
|
styles [
|
|
|
|
"caption",
|
|
|
|
"numeric",
|
|
|
|
]
|
|
|
|
|
2024-11-05 08:29:08 +00:00
|
|
|
label: bind $format_timestamp(template.duration) as <string>;
|
2024-10-19 15:04:56 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Box {
|
|
|
|
halign: center;
|
|
|
|
orientation: horizontal;
|
|
|
|
|
|
|
|
Button {
|
|
|
|
icon-name: "media-skip-backward";
|
|
|
|
valign: center;
|
2024-11-05 09:01:07 +00:00
|
|
|
sensitive: bind template.idle-active inverted;
|
2024-11-05 08:29:08 +00:00
|
|
|
clicked => $on_skip_backward_clicked() swapped;
|
2024-10-19 15:04:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
Button {
|
|
|
|
icon-name: "media-seek-backward";
|
|
|
|
valign: center;
|
2024-11-05 09:01:07 +00:00
|
|
|
sensitive: bind template.idle-active inverted;
|
2024-11-05 08:29:08 +00:00
|
|
|
clicked => $seek_backward() swapped;
|
2024-10-19 15:04:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
Button {
|
2024-11-05 08:29:08 +00:00
|
|
|
icon-name: bind $play_pause_icon_name(template.idle-active, template.pause) as <string>;
|
2024-10-19 15:04:56 +00:00
|
|
|
valign: center;
|
2024-11-05 09:01:07 +00:00
|
|
|
sensitive: bind $play_pause_sensitive(template.playlist-count) as <bool>;
|
2024-11-05 08:29:08 +00:00
|
|
|
clicked => $on_play_pause_clicked() swapped;
|
2024-10-19 15:04:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
Button {
|
|
|
|
icon-name: "media-seek-forward";
|
|
|
|
valign: center;
|
2024-11-05 09:01:07 +00:00
|
|
|
sensitive: bind template.idle-active inverted;
|
2024-11-05 08:29:08 +00:00
|
|
|
clicked => $seek_forward() swapped;
|
2024-10-19 15:04:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
Button {
|
|
|
|
icon-name: "media-skip-forward";
|
|
|
|
valign: center;
|
2024-11-05 09:01:07 +00:00
|
|
|
sensitive: bind template.idle-active inverted;
|
2024-11-05 08:29:08 +00:00
|
|
|
clicked => $on_skip_forward_clicked() swapped;
|
2024-10-19 15:04:56 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
[end]
|
|
|
|
Box {
|
|
|
|
Button {
|
|
|
|
icon-name: "non-starred";
|
|
|
|
valign: center;
|
|
|
|
}
|
|
|
|
|
|
|
|
Button {
|
2024-11-05 08:29:08 +00:00
|
|
|
icon-name: bind $mute_button_icon_name(template.mute) as <string>;
|
2024-10-19 15:04:56 +00:00
|
|
|
valign: center;
|
2024-11-05 08:29:08 +00:00
|
|
|
clicked => $on_mute_toggle() swapped;
|
2024-10-19 15:04:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
Scale {
|
|
|
|
name: "volume-scale";
|
|
|
|
orientation: horizontal;
|
|
|
|
width-request: 130;
|
|
|
|
|
|
|
|
adjustment: Adjustment {
|
|
|
|
lower: 0;
|
|
|
|
value: bind template.volume bidirectional;
|
|
|
|
upper: 100;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
2024-10-28 08:52:50 +00:00
|
|
|
};
|
2024-10-19 15:04:56 +00:00
|
|
|
}
|