|
|
1205f8 |
From a28e752ac10f9882d33a52189fc237d11d541fed Mon Sep 17 00:00:00 2001
|
|
|
1205f8 |
From: Ray Strode <rstrode@redhat.com>
|
|
|
1205f8 |
Date: Tue, 21 Jan 2014 16:48:17 -0500
|
|
|
1205f8 |
Subject: [PATCH] apps-menu: add logo icon to Applications menu
|
|
|
1205f8 |
|
|
|
1205f8 |
Brand requested it.
|
|
|
1205f8 |
---
|
|
|
1205f8 |
extensions/apps-menu/extension.js | 22 +++++++++++++++++++++-
|
|
|
1205f8 |
1 file changed, 21 insertions(+), 1 deletion(-)
|
|
|
1205f8 |
|
|
|
1205f8 |
diff --git a/extensions/apps-menu/extension.js b/extensions/apps-menu/extension.js
|
|
|
1205f8 |
index 6376b524..1b1f01f1 100644
|
|
|
1205f8 |
--- a/extensions/apps-menu/extension.js
|
|
|
1205f8 |
+++ b/extensions/apps-menu/extension.js
|
|
|
1205f8 |
@@ -363,13 +363,24 @@ class ApplicationsButton extends PanelMenu.Button {
|
|
|
1205f8 |
// role ATK_ROLE_MENU like other elements of the panel.
|
|
|
1205f8 |
this.accessible_role = Atk.Role.LABEL;
|
|
|
1205f8 |
|
|
|
1205f8 |
+ const hbox = new St.BoxLayout({ style_class: 'panel-status-menu-box' });
|
|
|
1205f8 |
+
|
|
|
1205f8 |
+ const iconFile = Gio.File.new_for_path(
|
|
|
1205f8 |
+ '/usr/share/icons/hicolor/scalable/apps/start-here.svg');
|
|
|
1205f8 |
+ this._icon = new St.Icon({
|
|
|
1205f8 |
+ gicon: new Gio.FileIcon({ file: iconFile }),
|
|
|
1205f8 |
+ style_class: 'panel-logo-icon',
|
|
|
1205f8 |
+ });
|
|
|
1205f8 |
+ hbox.add_actor(this._icon);
|
|
|
1205f8 |
+
|
|
|
1205f8 |
this._label = new St.Label({
|
|
|
1205f8 |
text: _('Applications'),
|
|
|
1205f8 |
y_expand: true,
|
|
|
1205f8 |
y_align: Clutter.ActorAlign.CENTER,
|
|
|
1205f8 |
});
|
|
|
1205f8 |
+ hbox.add_actor(this._label);
|
|
|
1205f8 |
|
|
|
1205f8 |
- this.add_actor(this._label);
|
|
|
1205f8 |
+ this.add_actor(hbox);
|
|
|
1205f8 |
this.name = 'panelApplications';
|
|
|
1205f8 |
this.label_actor = this._label;
|
|
|
1205f8 |
|
|
|
1205f8 |
@@ -403,6 +414,14 @@ class ApplicationsButton extends PanelMenu.Button {
|
|
|
1205f8 |
this._display();
|
|
|
1205f8 |
this._installedChangedId = appSys.connect('installed-changed',
|
|
|
1205f8 |
this._onTreeChanged.bind(this));
|
|
|
1205f8 |
+ this._sessionUpdatedId = Main.sessionMode.connect('updated',
|
|
|
1205f8 |
+ this._sessionUpdated.bind(this));
|
|
|
1205f8 |
+ this._sessionUpdated();
|
|
|
1205f8 |
+ }
|
|
|
1205f8 |
+
|
|
|
1205f8 |
+ _sessionUpdated() {
|
|
|
1205f8 |
+ this._icon.visible =
|
|
|
1205f8 |
+ !Main.sessionMode.panel.left.includes('activities');
|
|
|
1205f8 |
}
|
|
|
1205f8 |
|
|
|
1205f8 |
_onTreeChanged() {
|
|
|
1205f8 |
@@ -428,6 +447,7 @@ class ApplicationsButton extends PanelMenu.Button {
|
|
|
1205f8 |
|
|
|
1205f8 |
Main.overview.disconnect(this._showingId);
|
|
|
1205f8 |
Main.overview.disconnect(this._hidingId);
|
|
|
1205f8 |
+ Main.sessionMode.disconnect(this._sessionUpdatedId);
|
|
|
1205f8 |
appSys.disconnect(this._installedChangedId);
|
|
|
1205f8 |
this._tree.disconnect(this._treeChangedId);
|
|
|
1205f8 |
this._tree = null;
|
|
|
1205f8 |
--
|
|
|
1205f8 |
2.31.1
|
|
|
1205f8 |
|