diff options
author | Lars Uebernickel <lars.uebernickel@canonical.com> | 2013-05-31 19:17:46 -0400 |
---|---|---|
committer | Lars Uebernickel <lars.uebernickel@canonical.com> | 2013-05-31 19:17:46 -0400 |
commit | 36272c5bdb7b66e1a8c6c6e96d4b9d45c5e6e600 (patch) | |
tree | a4b0f90a0a9c87e0d2e643812c54959b4a96a313 /src | |
parent | 26315a5b447b10ac5926c9713e13dfd2383ccb95 (diff) | |
download | ayatana-indicator-sound-36272c5bdb7b66e1a8c6c6e96d4b9d45c5e6e600.tar.gz ayatana-indicator-sound-36272c5bdb7b66e1a8c6c6e96d4b9d45c5e6e600.tar.bz2 ayatana-indicator-sound-36272c5bdb7b66e1a8c6c6e96d4b9d45c5e6e600.zip |
Set attributes describing the slider menu item
Diffstat (limited to 'src')
-rw-r--r-- | src/service.vala | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/service.vala b/src/service.vala index dc3ccbb..468c80f 100644 --- a/src/service.vala +++ b/src/service.vala @@ -17,6 +17,9 @@ * Lars Uebernickel <lars.uebernickel@canonical.com> */ +/* Icon.serialize() is not yet in gio-2.0.vapi; remove this when it is */ +extern Variant? g_icon_serialize (Icon icon); + public class IndicatorSound.Service { public Service () { this.settings = new Settings ("com.canonical.indicator.sound"); @@ -90,11 +93,17 @@ public class IndicatorSound.Service { } static Menu create_menu () { + var menu = new Menu (); menu.append ("Mute", "indicator.mute"); var slider = new MenuItem (null, "indicator.volume"); slider.set_attribute ("x-canonical-type", "s", "com.canonical.unity.slider"); + slider.set_attribute_value ("primary-icon", g_icon_serialize (new ThemedIcon ("audio-volume-low-zero-panel"))); + slider.set_attribute_value ("secondary-icon", g_icon_serialize (new ThemedIcon ("audio-volume-high-panel"))); + slider.set_attribute ("min-value", "d", 0.0); + slider.set_attribute ("max-value", "d", 1.0); + slider.set_attribute ("step", "d", 0.01); menu.append_item (slider); menu.append ("Sound Settingsā¦", "indicator.settings"); |