audrey/resources/playbar.blp

188 lines
4.3 KiB
Text
Raw Normal View History

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 {
child: Overlay {
[overlay]
ProgressBar pulse_bar {
styles [
"osd"
]
visible: bind template.show-pulse-bar;
valign: start;
}
child: CenterBox {
hexpand: true;
2024-11-05 08:29:08 +00:00
styles [
"toolbar",
]
[start]
Box {
AspectFrame {
visible: false; // FIXME annoying annoying annoying annoying
// visible: bind template.show_cover_art;
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
Box {
margin-start: 6;
orientation: vertical;
valign: center;
2024-11-05 08:29:08 +00:00
Label {
styles [
"heading"
]
xalign: 0;
halign: start;
2024-11-05 14:38:46 +00:00
label: bind $song_title(template.song) as <string>;
ellipsize: end;
}
Label {
styles [
"caption"
]
xalign: 0;
2024-11-05 14:38:46 +00:00
label: bind $song_artist(template.song) as <string>;
ellipsize: end;
}
Label {
styles [
"caption"
]
xalign: 0;
2024-11-05 14:38:46 +00:00
label: bind $song_album(template.song) as <string>;
ellipsize: end;
}
}
2024-10-19 15:04:56 +00:00
}
[center]
Box {
orientation: vertical;
valign: center;
2024-10-19 15:04:56 +00:00
CenterBox {
[start]
Label play_position_label {
styles [
"caption",
"numeric",
]
label: bind $format_timestamp(template.position) as <string>;
}
[center]
Scale play_position {
name: "seek-scale";
orientation: horizontal;
width-request: 400;
sensitive: bind template.idle-active inverted;
adjustment: Adjustment {
lower: 0;
value: bind template.position;
upper: bind template.duration;
};
change-value => $on_play_position_seek() swapped;
}
[end]
Label play_duration {
styles [
"caption",
"numeric",
]
label: bind $format_timestamp(template.duration) as <string>;
}
2024-10-19 15:04:56 +00:00
}
Box {
halign: center;
2024-10-19 15:04:56 +00:00
orientation: horizontal;
Button {
icon-name: "media-skip-backward";
valign: center;
sensitive: bind template.idle-active inverted;
clicked => $on_skip_backward_clicked() swapped;
}
Button {
icon-name: "media-seek-backward";
valign: center;
sensitive: bind template.idle-active inverted;
clicked => $seek_backward() swapped;
}
Button {
icon-name: bind $play_pause_icon_name(template.idle-active, template.pause) as <string>;
valign: center;
sensitive: bind $play_pause_sensitive(template.playlist-count) as <bool>;
clicked => $on_play_pause_clicked() swapped;
}
Button {
icon-name: "media-seek-forward";
valign: center;
sensitive: bind template.idle-active inverted;
clicked => $seek_forward() swapped;
}
Button {
icon-name: "media-skip-forward";
valign: center;
sensitive: bind template.idle-active inverted;
clicked => $on_skip_forward_clicked() swapped;
}
2024-10-19 15:04:56 +00:00
}
}
[end]
2024-10-19 15:04:56 +00:00
Box {
Button {
icon-name: "non-starred";
2024-10-19 15:04:56 +00:00
valign: center;
2024-11-05 09:01:07 +00:00
sensitive: bind template.idle-active inverted;
2024-10-19 15:04:56 +00:00
}
Button {
icon-name: bind $mute_button_icon_name(template.mute) as <string>;
2024-10-19 15:04:56 +00:00
valign: center;
clicked => $on_mute_toggle() swapped;
2024-10-19 15:04:56 +00:00
}
Scale {
name: "volume-scale";
orientation: horizontal;
width-request: 130;
2024-10-19 15:04:56 +00:00
adjustment: Adjustment {
lower: 0;
value: bind template.volume bidirectional;
upper: 100;
};
2024-10-19 15:04:56 +00:00
}
}
};
2024-10-28 08:52:50 +00:00
};
2024-10-19 15:04:56 +00:00
}