diff options
author | Charles Kerr <charles.kerr@canonical.com> | 2016-01-05 13:13:41 -0600 |
---|---|---|
committer | Charles Kerr <charles.kerr@canonical.com> | 2016-01-05 13:13:41 -0600 |
commit | 7dcc73303a60aba6c636408fa22ccaed07baf64c (patch) | |
tree | b0b4a1fa061be766576e663ac67c63fd2b445563 /src/sound-menu.vala | |
parent | 3c528a11f39af91d2856aeac606fdaf8a6c6b673 (diff) | |
parent | 6f4f8c2b9caee08499a3a9ee3fd434c2b6a0f3ca (diff) | |
download | ayatana-indicator-sound-7dcc73303a60aba6c636408fa22ccaed07baf64c.tar.gz ayatana-indicator-sound-7dcc73303a60aba6c636408fa22ccaed07baf64c.tar.bz2 ayatana-indicator-sound-7dcc73303a60aba6c636408fa22ccaed07baf64c.zip |
adding lp:~xavi-garcia-mena/indicator-sound/action-sync-volume
Diffstat (limited to 'src/sound-menu.vala')
-rw-r--r-- | src/sound-menu.vala | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/sound-menu.vala b/src/sound-menu.vala index 3d682e4..bdb8df2 100644 --- a/src/sound-menu.vala +++ b/src/sound-menu.vala @@ -46,7 +46,7 @@ public class SoundMenu: Object volume_section.append_item (this.create_slider_menu_item (_("Volume"), "indicator.volume(0)", 0.0, 1.0, 0.01, "audio-volume-low-zero-panel", - "audio-volume-high-panel")); + "audio-volume-high-panel", true)); this.menu = new Menu (); this.menu.append_section (null, volume_section); @@ -101,7 +101,7 @@ public class SoundMenu: Object if (value && !this.mic_volume_shown) { var slider = this.create_slider_menu_item (_("Microphone Volume"), "indicator.mic-volume", 0.0, 1.0, 0.01, "audio-input-microphone-low-zero-panel", - "audio-input-microphone-high-panel"); + "audio-input-microphone-high-panel", false); volume_section.append_item (slider); this.mic_volume_shown = true; } @@ -227,7 +227,7 @@ public class SoundMenu: Object 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")); + "audio-volume-high-panel", true)); } } @@ -386,7 +386,7 @@ public class SoundMenu: Object } } - MenuItem create_slider_menu_item (string label, string action, double min, double max, double step, string min_icon_name, string max_icon_name) { + MenuItem create_slider_menu_item (string label, string action, double min, double max, double step, string min_icon_name, string max_icon_name, bool sync_action) { var min_icon = new ThemedIcon.with_default_fallbacks (min_icon_name); var max_icon = new ThemedIcon.with_default_fallbacks (max_icon_name); @@ -397,6 +397,9 @@ public class SoundMenu: Object slider.set_attribute ("min-value", "d", min); slider.set_attribute ("max-value", "d", max); slider.set_attribute ("step", "d", step); + if (sync_action) { + slider.set_attribute ("x-canonical-sync-action", "s", "indicator.volume-sync"); + } return slider; } |