aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMatthieu Baerts <matttbe@gmail.com>2013-08-28 14:20:24 +0200
committerMatthieu Baerts <matttbe@gmail.com>2013-08-28 14:20:24 +0200
commit09910321e6c720fe0d219d0342e7efaee0b30051 (patch)
tree758fac1d1646b74c2da11950baa8f07e3a6bf5a4 /lib
parent5324c5048e592aa6b4301ab96c3bda6facc131e5 (diff)
downloadayatana-indicator-keyboard-09910321e6c720fe0d219d0342e7efaee0b30051.tar.gz
ayatana-indicator-keyboard-09910321e6c720fe0d219d0342e7efaee0b30051.tar.bz2
ayatana-indicator-keyboard-09910321e6c720fe0d219d0342e7efaee0b30051.zip
Added an 'accessible description'
This description is used by other applications (like Cairo-Dock) as label for this icon.
Diffstat (limited to 'lib')
-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)]