aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthieu Baerts <matttbe@gmail.com>2013-08-28 13:14:16 +0000
committerTarmac <Unknown>2013-08-28 13:14:16 +0000
commite322058091faf384ee8e8ba21dc09aa2203656c6 (patch)
tree758fac1d1646b74c2da11950baa8f07e3a6bf5a4
parent5324c5048e592aa6b4301ab96c3bda6facc131e5 (diff)
parent09910321e6c720fe0d219d0342e7efaee0b30051 (diff)
downloadayatana-indicator-keyboard-e322058091faf384ee8e8ba21dc09aa2203656c6.tar.gz
ayatana-indicator-keyboard-e322058091faf384ee8e8ba21dc09aa2203656c6.tar.bz2
ayatana-indicator-keyboard-e322058091faf384ee8e8ba21dc09aa2203656c6.zip
Added an 'accessible description'
This description is used by other applications (like Cairo-Dock) as label for this icon. Fixes: https://bugs.launchpad.net/bugs/1217855. Approved by PS Jenkins bot, William Hua.
-rw-r--r--lib/main.vala14
1 files changed, 9 insertions, 5 deletions
diff --git a/lib/main.vala b/lib/main.vala
index 83e31dc0..d8b6588e 100644
--- a/lib/main.vala
+++ b/lib/main.vala
@@ -355,20 +355,24 @@ public class Indicator.Keyboard.Service : Object {
var current = source_settings.get_uint ("current");
var sources = get_sources ();
- Variant state;
Icon? icon = null;
+ string? name = null;
if (current < sources.length) {
icon = sources[current].icon;
+ name = sources[current].name;
}
+ var builder = new VariantBuilder (new VariantType ("a{sv}"));
+ builder.add ("{sv}", "visible", new Variant.boolean (visible));
+ if (name != null) {
+ builder.add ("{sv}", "accessible-desc", new Variant.string ((!) name));
+ }
if (icon != null) {
- state = new Variant.parsed ("{ 'visible' : <%b>, 'icon' : %v }", visible, ((!) icon).serialize ());
- } else {
- state = new Variant.parsed ("{ 'visible' : <%b> }", visible);
+ builder.add ("{sv}", "icon", ((!) icon).serialize ());
}
- get_indicator_action ().set_state (state);
+ get_indicator_action ().set_state (builder.end ());
}
[DBus (visible = false)]