From bac519034d39e385ed8b7a84374405fd9fb96e19 Mon Sep 17 00:00:00 2001 From: Erica Z Date: Tue, 15 Oct 2024 22:33:39 +0200 Subject: [PATCH] fix those buttons --- src/ui/window.blp | 12 ++++++------ src/ui/window.vala | 5 ++--- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/ui/window.blp b/src/ui/window.blp index eb328ca..034e3d2 100644 --- a/src/ui/window.blp +++ b/src/ui/window.blp @@ -172,7 +172,7 @@ template $UiWindow: Adw.ApplicationWindow { Button { icon-name: "media-skip-backward"; valign: center; - //sensitive: bind $playbin_active (template.playbin as <$Playbin>.state as <$PlaybinState>) as ; + sensitive: bind $playbin_active (template.playbin as <$Playbin>.state as <$PlaybinState>) as ; clicked => $on_skip_backward_clicked (); } @@ -180,15 +180,15 @@ template $UiWindow: Adw.ApplicationWindow { Button { icon-name: "media-seek-backward"; valign: center; - //sensitive: bind $playbin_active (template.playbin as <$Playbin>.state as <$PlaybinState>) as ; + sensitive: bind $playbin_active (template.playbin as <$Playbin>.state as <$PlaybinState>) as ; clicked => $seek_backward (); } Button { - //icon-name: bind $play_pause_icon_name (template.playbin as <$Playbin>.state as <$PlaybinState>) as ; + icon-name: bind $play_pause_icon_name (template.playbin as <$Playbin>.state as <$PlaybinState>) as ; valign: center; - //sensitive: bind $playbin_active (template.playbin as <$Playbin>.state as <$PlaybinState>) as ; + sensitive: bind $playbin_active (template.playbin as <$Playbin>.state as <$PlaybinState>) as ; clicked => $on_play_pause_clicked (); } @@ -196,7 +196,7 @@ template $UiWindow: Adw.ApplicationWindow { Button { icon-name: "media-seek-forward"; valign: center; - //sensitive: bind $playbin_active (template.playbin as <$Playbin>.state as <$PlaybinState>) as ; + sensitive: bind $playbin_active (template.playbin as <$Playbin>.state as <$PlaybinState>) as ; clicked => $seek_forward (); } @@ -204,7 +204,7 @@ template $UiWindow: Adw.ApplicationWindow { Button { icon-name: "media-skip-forward"; valign: center; - //sensitive: bind $playbin_active (template.playbin as <$Playbin>.state as <$PlaybinState>) as ; + sensitive: bind $playbin_active (template.playbin as <$Playbin>.state as <$PlaybinState>) as ; clicked => $on_skip_forward_clicked (); } diff --git a/src/ui/window.vala b/src/ui/window.vala index d76c820..3419a83 100644 --- a/src/ui/window.vala +++ b/src/ui/window.vala @@ -27,7 +27,7 @@ class Ui.Window : Adw.ApplicationWindow { public bool cover_art_loading { get; set; default = false; } public Gdk.Paintable playing_cover_art { get; set; } - internal Playbin playbin = new Playbin (); + public Playbin playbin { get; private set; default = new Playbin (); } public PlayQueueSelection play_queue_model { get; private set; default = new PlayQueueSelection (); } public Window (Gtk.Application app) { @@ -168,7 +168,6 @@ class Ui.Window : Adw.ApplicationWindow { } } -/* [GtkCallback] private string play_pause_icon_name (PlaybinState state) { if (state == PlaybinState.PLAYING) { return "media-playback-pause"; @@ -179,7 +178,7 @@ class Ui.Window : Adw.ApplicationWindow { [GtkCallback] private bool playbin_active (PlaybinState state) { return state != PlaybinState.STOPPED; - }*/ + } [GtkCallback] private string mute_button_icon_name (bool mute) { return mute ? "audio-volume-muted" : "audio-volume-high";