diff options
author | Xavi Garcia Mena <xavi.garcia.mena@canonical.com> | 2015-09-29 14:13:45 +0200 |
---|---|---|
committer | Xavi Garcia Mena <xavi.garcia.mena@canonical.com> | 2015-09-29 14:13:45 +0200 |
commit | a7fd579fd1bc6eb02433ccd72e9f54dca2615675 (patch) | |
tree | 43892b38a791ff60f31cbd10041539a6fcf245ba /src/sound-menu.vala | |
parent | 918c9b9a95573b0dfe0e2e67ef30b998b5576e82 (diff) | |
download | ayatana-indicator-sound-a7fd579fd1bc6eb02433ccd72e9f54dca2615675.tar.gz ayatana-indicator-sound-a7fd579fd1bc6eb02433ccd72e9f54dca2615675.tar.bz2 ayatana-indicator-sound-a7fd579fd1bc6eb02433ccd72e9f54dca2615675.zip |
Adding the code to change the icons and label when a bluetooth headset is connected
Diffstat (limited to 'src/sound-menu.vala')
-rw-r--r-- | src/sound-menu.vala | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/sound-menu.vala b/src/sound-menu.vala index 8718162..8f63d69 100644 --- a/src/sound-menu.vala +++ b/src/sound-menu.vala @@ -71,6 +71,7 @@ public class SoundMenu: Object this.notify_handlers = new HashTable<MediaPlayer, ulong> (direct_hash, direct_equal); this.greeter_players = (flags & DisplayFlags.GREETER_PLAYERS) != 0; + } ~SoundMenu () { @@ -185,6 +186,17 @@ public class SoundMenu: Object this.notify_handlers.remove (player); } + public void update_volume_slider (bool bluetooth_headset_active) { + int index = find_action (this.volume_section, "indicator.volume"); + if (index != -1) { + string label = bluetooth_headset_active ? "Volume (Bluetooth)" : "Volume"; + this.volume_section.remove (index); + this.volume_section.insert_item (index, this.create_slider_menu_item (_(label), "indicator.volume(0)", 0.0, 1.0, 0.01, + "audio-volume-low-zero-panel", + "audio-volume-high-panel")); + } + } + public Menu root; public Menu menu; Menu volume_section; |