summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Müllner <fmuellner@gnome.org>2018-07-24 16:40:03 +0200
committerFlorian Müllner <fmuellner@gnome.org>2018-07-25 13:41:28 +0200
commit4a12c14287168df9d39b762e0977b46b2811d9dd (patch)
tree8d962b6d90447b06f7e82a3fe1ebd52cf1f5773f
parentd52ad8da988ff6b1988012ab6dbbfe13d6e78811 (diff)
downloadgnome-shell-wip/fmuellner/settings-app-icon.tar.gz
system: Pick up Settings name and icon from appwip/fmuellner/settings-app-icon
The settings action button in the system menu simply launches gnome-control-center, so we want its icon (and accessible name) to always match the app. So instead of keeping the button in-sync with Settings, just look up that information from the app itself. https://gitlab.gnome.org/GNOME/gnome-shell/issues/433
-rw-r--r--js/ui/status/system.js19
1 files changed, 15 insertions, 4 deletions
diff --git a/js/ui/status/system.js b/js/ui/status/system.js
index 777e95956..f18dee7b1 100644
--- a/js/ui/status/system.js
+++ b/js/ui/status/system.js
@@ -261,8 +261,20 @@ var Indicator = new Lang.Class({
item = new PopupMenu.PopupBaseMenuItem({ reactive: false,
can_focus: false });
- this._settingsAction = this._createActionButton('preferences-system', _("Settings"));
- this._settingsAction.connect('clicked', () => { this._onSettingsClicked(); });
+ let app = this._settingsApp = Shell.AppSystem.get_default().lookup_app(
+ 'gnome-control-center.desktop'
+ );
+ if (app) {
+ let [icon, name] = [app.app_info.get_icon().names[0],
+ app.get_name()];
+ this._settingsAction = this._createActionButton(icon, name);
+ this._settingsAction.connect('clicked', () => {
+ this._onSettingsClicked();
+ });
+ } else {
+ log('Missing required core component Settings, expect trouble ...');
+ this._settingsAction = new St.Widget();
+ }
item.actor.add(this._settingsAction, { expand: true, x_fill: false });
this._orientationLockAction = this._createActionButton('', _("Orientation Lock"));
@@ -330,8 +342,7 @@ var Indicator = new Lang.Class({
_onSettingsClicked() {
this.menu.itemActivated();
- let app = Shell.AppSystem.get_default().lookup_app('gnome-control-center.desktop');
Main.overview.hide();
- app.activate();
+ this._settingsApp.activate();
}
});