From 6ce79c62eb624f33481dee68454b41b1034052a8 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Sun, 14 Apr 2013 09:35:56 -0400 Subject: [PATCH] Make it possible to always show the a11y status A switch for this is part of the redesign for the universal access control-center panel. https://bugzilla.gnome.org/show_bug.cgi?id=698001 --- data/org.gnome.shell.gschema.xml.in.in | 8 ++++++++ js/ui/status/accessibility.js | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/data/org.gnome.shell.gschema.xml.in.in b/data/org.gnome.shell.gschema.xml.in.in index bacb6b1c8..e45274eb6 100644 --- a/data/org.gnome.shell.gschema.xml.in.in +++ b/data/org.gnome.shell.gschema.xml.in.in @@ -73,6 +73,14 @@ value here is from the GsmPresenceStatus enumeration. menuitem in single-user, single-session situations. + + false + <_summary>Always show the Universal Access status. + <_description> + This key overrides the automatic hiding of the Universal + Access status icon when no accessibility features are enabled. + + false <_summary>Whether to remember password for mounting encrypted or remote filesystems diff --git a/js/ui/status/accessibility.js b/js/ui/status/accessibility.js index 479a15a70..b18af855b 100644 --- a/js/ui/status/accessibility.js +++ b/js/ui/status/accessibility.js @@ -26,6 +26,8 @@ const KEY_ICON_THEME = 'icon-theme'; const KEY_WM_THEME = 'theme'; const KEY_TEXT_SCALING_FACTOR = 'text-scaling-factor'; +const KEY_ALWAYS_SHOW_UNIVERSAL_ACCESS = 'always-show-universal-access'; + const HIGH_CONTRAST_THEME = 'HighContrast'; const ATIndicator = new Lang.Class({ @@ -71,12 +73,18 @@ const ATIndicator = new Lang.Class({ this.menu.addMenuItem(new PopupMenu.PopupSeparatorMenuItem()); this.menu.addSettingsAction(_("Universal Access Settings"), 'gnome-universal-access-panel.desktop'); + global.settings.connect('changed::' + KEY_ALWAYS_SHOW_UNIVERSAL_ACCESS, Lang.bind (this, this._queueSyncMenuVisibility)); + this._syncMenuVisibility(); }, _syncMenuVisibility: function() { this._syncMenuVisibilityIdle = 0; + if (global.settings.get_boolean(KEY_ALWAYS_SHOW_UNIVERSAL_ACCESS)) { + this.actor.visible = true; + return false; + } let items = this.menu._getMenuItems(); this.actor.visible = items.some(function(f) { return !!f.state; });