From 09910321e6c720fe0d219d0342e7efaee0b30051 Mon Sep 17 00:00:00 2001 From: Matthieu Baerts Date: Wed, 28 Aug 2013 14:20:24 +0200 Subject: Added an 'accessible description' This description is used by other applications (like Cairo-Dock) as label for this icon. --- lib/main.vala | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'lib') 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)] -- cgit v1.2.3