"fix" play button
This commit is contained in:
parent
a5091d42e0
commit
e925dc33cc
2 changed files with 3 additions and 2 deletions
|
@ -1,5 +1,6 @@
|
||||||
using Gtk 4.0;
|
using Gtk 4.0;
|
||||||
using Adw 1;
|
using Adw 1;
|
||||||
|
using Gio 2.0;
|
||||||
|
|
||||||
template $UiPlaybar: Adw.Bin {
|
template $UiPlaybar: Adw.Bin {
|
||||||
child: CenterBox {
|
child: CenterBox {
|
||||||
|
@ -119,7 +120,7 @@ template $UiPlaybar: Adw.Bin {
|
||||||
Button {
|
Button {
|
||||||
icon-name: bind $play_pause_icon_name (template.playbin as <$Playbin>.state as <$PlaybinState>) as <string>;
|
icon-name: bind $play_pause_icon_name (template.playbin as <$Playbin>.state as <$PlaybinState>) as <string>;
|
||||||
valign: center;
|
valign: center;
|
||||||
sensitive: bind $can_press_play (template.playbin as <$Playbin>.state as <$PlaybinState>, template.playbin as <$Playbin>.play_queue_position) as <bool>;
|
sensitive: bind $can_press_play (template.playbin as <$Playbin>.state as <$PlaybinState>, template.playbin as <$Playbin>.play_queue as <Gio.ListStore>.n-items) as <bool>;
|
||||||
|
|
||||||
clicked => $on_play_pause_clicked ();
|
clicked => $on_play_pause_clicked ();
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,7 +42,7 @@ class Ui.Playbar : Adw.Bin {
|
||||||
}
|
}
|
||||||
|
|
||||||
[GtkCallback] private bool can_press_play (PlaybinState state, uint n_items) {
|
[GtkCallback] private bool can_press_play (PlaybinState state, uint n_items) {
|
||||||
return state != PlaybinState.STOPPED || n_items > 0;
|
return !(state == PlaybinState.STOPPED && n_items == 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
[GtkCallback] private string mute_button_icon_name (bool mute) {
|
[GtkCallback] private string mute_button_icon_name (bool mute) {
|
||||||
|
|
Loading…
Reference in a new issue