Blame SOURCES/0001-apps-menu-add-logo-icon-to-Applications-menu.patch

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