diff options
author | Charles Kerr <charles.kerr@canonical.com> | 2013-12-06 15:36:56 +0000 |
---|---|---|
committer | Charles Kerr <charles.kerr@canonical.com> | 2013-12-06 15:36:56 +0000 |
commit | a3b7b1c7db28b8e89fe5e1dbd671ed73e85feb05 (patch) | |
tree | 3183368198fcb0d6a23be6adc695ba158510b300 /src | |
parent | abc3e28dc72d9641e2ce07d0d99a23ac23e4f3b6 (diff) | |
download | ayatana-indicator-bluetooth-a3b7b1c7db28b8e89fe5e1dbd671ed73e85feb05.tar.gz ayatana-indicator-bluetooth-a3b7b1c7db28b8e89fe5e1dbd671ed73e85feb05.tar.bz2 ayatana-indicator-bluetooth-a3b7b1c7db28b8e89fe5e1dbd671ed73e85feb05.zip |
support header icon states as per the spec -- different icons for disabled, enabled, and enabled-with-connected-devices
Diffstat (limited to 'src')
-rw-r--r-- | src/profile.vala | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/profile.vala b/src/profile.vala index 6aedec3..96ec780 100644 --- a/src/profile.vala +++ b/src/profile.vala @@ -37,7 +37,8 @@ class Profile: Object null, action_state_for_root()); notify["visible"].connect (() => update_root_action_state()); - + bluetooth.notify["enabled"].connect (() => update_root_action_state()); + bluetooth.notify["connected"].connect (() => update_root_action_state()); menu = new Menu (); var item = create_root_menuitem (); @@ -146,7 +147,13 @@ class Profile: Object { string a11y; string icon_name; - if (bluetooth.enabled) + + if (bluetooth.connected) + { + a11y = "Bluetooth (connections)"; + icon_name = "bluetooth-paired"; + } + else if (bluetooth.enabled) { a11y = "Bluetooth (on)"; icon_name = "bluetooth-active"; @@ -158,7 +165,6 @@ class Profile: Object } var icon = new ThemedIcon.with_default_fallbacks (icon_name); - var builder = new VariantBuilder (new VariantType ("a{sv}")); builder.add ("{sv}", "visible", new Variant.boolean (visible)); builder.add ("{sv}", "accessible-desc", new Variant.string (a11y)); |