audrey/resources/playbar.blp

213 lines
4.7 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"
]
2024-11-13 17:49:08 +00:00
visible: bind template.show-pulse-bar;
valign: start;
}
child: CenterBox {
hexpand: true;
2024-11-05 08:29:08 +00:00
styles [
"toolbar",
]
[start]
2024-11-16 13:42:17 +00:00
Box start {
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;
2024-11-05 14:38:46 +00:00
label: bind $song_title(template.song) as <string>;
ellipsize: end;
2024-11-25 22:04:28 +00:00
max-width-chars: 1;
hexpand: true;
}
Label {
styles [
"caption"
]
xalign: 0;
2024-11-05 14:38:46 +00:00
label: bind $song_artist(template.song) as <string>;
ellipsize: end;
2024-11-25 22:04:28 +00:00
max-width-chars: 1;
hexpand: true;
}
Label {
styles [
"caption"
]
xalign: 0;
2024-11-05 14:38:46 +00:00
label: bind $song_album(template.song) as <string>;
ellipsize: end;
2024-11-25 22:04:28 +00:00
max-width-chars: 1;
hexpand: true;
}
}
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;
2024-11-13 18:40:04 +00:00
action-name: "app.seek-backward";
}
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;
2024-11-13 18:40:04 +00:00
action-name: "app.seek-forward";
}
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-11-16 13:42:17 +00:00
Box end {
Separator {
2024-11-25 19:18:10 +00:00
styles [
"spacer"
]
hexpand: true;
}
2024-10-19 15:04:56 +00:00
Button {
2024-11-16 13:35:36 +00:00
icon-name: "heart-empty-symbolic"; // placeholder
halign: end;
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>;
halign: end;
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;
halign: end;
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
}
2024-11-16 13:42:17 +00:00
// make sure the middle is centered always
SizeGroup {
mode: horizontal;
2024-11-25 19:18:10 +00:00
widgets [
start,
end
]
2024-11-16 13:42:17 +00:00
}