From 8d7903b0c5886e0710736782aeba5aafc5c3e1ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Mon, 19 Jun 2023 13:18:38 -0700 Subject: [PATCH] Set volume scales sensitive based on device (#244) --- src/InputPanel.vala | 4 ++-- src/OutputPanel.vala | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/InputPanel.vala b/src/InputPanel.vala index 1fe47006..8ddbdb14 100644 --- a/src/InputPanel.vala +++ b/src/InputPanel.vala @@ -89,8 +89,6 @@ public class Sound.InputPanel : Gtk.Box { default_changed (); }); - volume_switch.bind_property ("active", volume_scale, "sensitive", BindingFlags.DEFAULT); - connect_signals (); } @@ -152,6 +150,8 @@ public class Sound.InputPanel : Gtk.Box { if (volume_switch.active == default_device.is_muted) { volume_switch.activate (); } + + volume_scale.sensitive = !default_device.is_muted; break; case "volume": volume_scale.set_value (default_device.volume); diff --git a/src/OutputPanel.vala b/src/OutputPanel.vala index 12ed171c..17880f46 100644 --- a/src/OutputPanel.vala +++ b/src/OutputPanel.vala @@ -144,9 +144,6 @@ public class Sound.OutputPanel : Gtk.Box { pam.new_device.connect (add_device); pam.notify["default-output"].connect (default_changed); - volume_switch.bind_property ("active", volume_scale, "sensitive", BindingFlags.DEFAULT); - volume_switch.bind_property ("active", balance_scale, "sensitive", BindingFlags.DEFAULT); - var sound_settings = new Settings ("org.gnome.desktop.sound"); sound_settings.bind ("event-sounds", audio_alert_check, "active", GLib.SettingsBindFlags.DEFAULT); @@ -237,6 +234,9 @@ public class Sound.OutputPanel : Gtk.Box { if (volume_switch.active == default_device.is_muted) { volume_switch.activate (); } + + balance_scale.sensitive = !default_device.is_muted; + volume_scale.sensitive = !default_device.is_muted; break; case "volume": volume_scale.set_value (default_device.volume);