diff options
author | Lars Uebernickel <lars.uebernickel@canonical.com> | 2013-07-24 06:01:54 +0000 |
---|---|---|
committer | Tarmac <Unknown> | 2013-07-24 06:01:54 +0000 |
commit | 63393f0130d9a1c0a252179660831676874f0a4b (patch) | |
tree | f3738e907f8a54b58ef03593c32372ee1654858f | |
parent | 362efec59bdb32c7198d49e9b2c39e2fd4817e71 (diff) | |
parent | 812adbd27ed4f5af7a0a78c9ad62e4b9337d8c0a (diff) | |
download | ayatana-indicator-sound-63393f0130d9a1c0a252179660831676874f0a4b.tar.gz ayatana-indicator-sound-63393f0130d9a1c0a252179660831676874f0a4b.tar.bz2 ayatana-indicator-sound-63393f0130d9a1c0a252179660831676874f0a4b.zip |
Specify fallback icons
The *-panel suffix is only used by the ubuntu-mono icon themes.
. Fixes: https://bugs.launchpad.net/bugs/1202932.
Approved by Charles Kerr, PS Jenkins bot.
-rw-r--r-- | src/service.vala | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/src/service.vala b/src/service.vala index 3d14d5e..e13c02e 100644 --- a/src/service.vala +++ b/src/service.vala @@ -62,7 +62,7 @@ public class IndicatorSound.Service { } const ActionEntry[] action_entries = { - { "root", null, null, "{ 'icon': <'audio-volume-high-panel'> }", null }, + { "root", null, null, "@a{sv} {}", null }, { "settings", activate_settings, null, null, null }, }; @@ -92,6 +92,13 @@ public class IndicatorSound.Service { } } + /* Returns a serialized version of @icon_name suited for the panel */ + static Variant serialize_themed_icon (string icon_name) + { + var icon = new ThemedIcon.with_default_fallbacks (icon_name); + return g_icon_serialize (icon); + } + static Menu create_root_menu (Menu submenu) { var root = new MenuItem (null, "indicator.root"); root.set_attribute ("x-canonical-type", "s", "com.canonical.indicator.root"); @@ -109,8 +116,8 @@ public class IndicatorSound.Service { var slider = new MenuItem (null, "indicator.volume"); slider.set_attribute ("x-canonical-type", "s", "com.canonical.unity.slider"); - slider.set_attribute_value ("min-icon", g_icon_serialize (new ThemedIcon ("audio-volume-low-zero-panel"))); - slider.set_attribute_value ("max-icon", g_icon_serialize (new ThemedIcon ("audio-volume-high-panel"))); + slider.set_attribute_value ("min-icon", serialize_themed_icon ("audio-volume-low-zero-panel")); + slider.set_attribute_value ("max-icon", serialize_themed_icon ("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); @@ -129,8 +136,8 @@ public class IndicatorSound.Service { if (volume_section.get_n_items () < 3) { var slider = new MenuItem (null, "indicator.mic-volume"); slider.set_attribute ("x-canonical-type", "s", "com.canonical.unity.slider"); - slider.set_attribute_value ("min-icon", g_icon_serialize (new ThemedIcon ("audio-input-microphone-low-zero-panel"))); - slider.set_attribute_value ("max-icon", g_icon_serialize (new ThemedIcon ("audio-input-microphone-high-panel"))); + slider.set_attribute_value ("min-icon", serialize_themed_icon ("audio-input-microphone-low-zero-panel")); + slider.set_attribute_value ("max-icon", serialize_themed_icon ("audio-input-microphone-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); @@ -158,7 +165,7 @@ public class IndicatorSound.Service { icon = "audio-volume-high-panel"; var root_action = this.actions.lookup ("root") as SimpleAction; - root_action.set_state (new Variant.parsed ("{ 'icon': <%s> }", icon)); + root_action.set_state (new Variant.parsed ("{ 'icon': %v }", serialize_themed_icon (icon))); } Action create_mute_action () { |