From cfff54659c516eef0813e3940606642a64b698d0 Mon Sep 17 00:00:00 2001 From: Ray Strode Date: Wed, 15 Jan 2014 16:45:34 -0500 Subject: [PATCH] panel: add an icon to the ActivitiesButton Requested by brand --- data/theme/gnome-shell.css | 5 +++++ js/ui/panel.js | 9 ++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/data/theme/gnome-shell.css b/data/theme/gnome-shell.css index 3727197..4191817 100644 --- a/data/theme/gnome-shell.css +++ b/data/theme/gnome-shell.css @@ -567,60 +567,65 @@ StScrollBar StButton#vhandle:active { #panel.login-screen .panel-button:focus { color: white; } .panel-button:hover { color: white; text-shadow: black 0px 2px 2px; } .panel-button:active, .panel-button:overview, .panel-button:focus { border-image: url("panel-button-border.svg") 6 10 0 2; background-image: url("panel-button-highlight-wide.svg"); color: white; text-shadow: black 0px 2px 2px; } .panel-status-button:active, .panel-status-button:checked, .panel-status-button:focus { background-image: url("panel-button-highlight-narrow.svg"); } .panel-button:active > .system-status-icon, .panel-button:checked > .system-status-icon, .panel-button:focus > .system-status-icon { icon-shadow: black 0px 2px 2px; } +.panel-logo-icon { + padding-right: .4em; + icon-size: 1em; +} + .panel-menu { -boxpointer-gap: 4px; } .panel-status-button-box { spacing: 4px; } .lock-screen-status-button-box { spacing: 8px; } /* User Menu */ #panelUserMenu { spacing: 4px; } .status-chooser { spacing: .4em; } .status-chooser .popup-menu-item, .status-chooser-combo .popup-menu-item { padding: .4em; } .status-chooser-user-icon { border: 2px solid #8b8b8b; border-radius: 5px; diff --git a/js/ui/panel.js b/js/ui/panel.js index a6f73a5..afea8c8 100644 --- a/js/ui/panel.js +++ b/js/ui/panel.js @@ -655,64 +655,71 @@ const AppMenuButton = new Lang.Class({ } if (this._overviewHidingId > 0) { Main.overview.disconnect(this._overviewHidingId); this._overviewHidingId = 0; } if (this._overviewShowingId > 0) { Main.overview.disconnect(this._overviewShowingId); this._overviewShowingId = 0; } if (this._switchWorkspaceNotifyId > 0) { global.window_manager.disconnect(this._switchWorkspaceNotifyId); this._switchWorkspaceNotifyId = 0; } this.parent(); } }); Signals.addSignalMethods(AppMenuButton.prototype); const ActivitiesButton = new Lang.Class({ Name: 'ActivitiesButton', Extends: PanelMenu.Button, _init: function() { this.parent(0.0, null, true); this.actor.accessible_role = Atk.Role.TOGGLE_BUTTON; this.actor.name = 'panelActivities'; + let box = new St.BoxLayout(); + this.actor.add_actor(box); + let iconFile = Gio.File.new_for_path('/usr/share/icons/hicolor/scalable/apps/start-here.svg'); + this._icon = new St.Icon({ gicon: new Gio.FileIcon({ file: iconFile }), + style_class: 'panel-logo-icon' }); + box.add_actor(this._icon); + /* Translators: If there is no suitable word for "Activities" in your language, you can use the word for "Overview". */ this._label = new St.Label({ text: _("Activities") }); - this.actor.add_actor(this._label); + box.add_actor(this._label); this.actor.label_actor = this._label; this.actor.connect('captured-event', Lang.bind(this, this._onCapturedEvent)); this.actor.connect_after('button-release-event', Lang.bind(this, this._onButtonRelease)); this.actor.connect_after('key-release-event', Lang.bind(this, this._onKeyRelease)); Main.overview.connect('showing', Lang.bind(this, function() { this.actor.add_style_pseudo_class('overview'); this.actor.add_accessible_state (Atk.StateType.CHECKED); })); Main.overview.connect('hiding', Lang.bind(this, function() { this.actor.remove_style_pseudo_class('overview'); this.actor.remove_accessible_state (Atk.StateType.CHECKED); })); this._xdndTimeOut = 0; }, handleDragOver: function(source, actor, x, y, time) { if (source != Main.xdndHandler) return DND.DragMotionResult.CONTINUE; if (this._xdndTimeOut != 0) Mainloop.source_remove(this._xdndTimeOut); this._xdndTimeOut = Mainloop.timeout_add(BUTTON_DND_ACTIVATION_TIMEOUT, Lang.bind(this, this._xdndToggleOverview, actor)); return DND.DragMotionResult.CONTINUE; }, -- 1.8.3.1