Skip to content

Commit

Permalink
Set volume scales sensitive based on device (#244)
Browse files Browse the repository at this point in the history
  • Loading branch information
danirabbit committed Jun 19, 2023
1 parent 9cdf932 commit 8d7903b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/InputPanel.vala
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,6 @@ public class Sound.InputPanel : Gtk.Box {
default_changed ();
});

volume_switch.bind_property ("active", volume_scale, "sensitive", BindingFlags.DEFAULT);

connect_signals ();
}

Expand Down Expand Up @@ -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);
Expand Down
6 changes: 3 additions & 3 deletions src/OutputPanel.vala
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 8d7903b

Please sign in to comment.