[gnome-shell-extensions/wip/fmuellner/fix-113-master: 8/17] apps-menu: Stop using compatibility actor property



commit 072fbee7cbaa11a2913adf81cbda314646473438
Author: Florian Müllner <fmuellner gnome org>
Date:   Wed Oct 10 16:26:20 2018 +0200

    apps-menu: Stop using compatibility actor property
    
    PanelMenu.Button sets up a `this.actor = this` property for compatibility,
    but let's reflect the actual new object hierarchy.
    
    https://gitlab.gnome.org/GNOME/gnome-shell-extensions/issues/113

 extensions/apps-menu/extension.js | 17 ++++++++---------
 1 file changed, 8 insertions(+), 9 deletions(-)
---
diff --git a/extensions/apps-menu/extension.js b/extensions/apps-menu/extension.js
index 1683914..adc77a4 100644
--- a/extensions/apps-menu/extension.js
+++ b/extensions/apps-menu/extension.js
@@ -406,13 +406,13 @@ class ApplicationsButton extends PanelMenu.Button {
     _init() {
         super._init(1.0, null, false);
 
-        this.setMenu(new ApplicationsMenu(this.actor, 1.0, St.Side.TOP, this));
+        this.setMenu(new ApplicationsMenu(this, 1.0, St.Side.TOP, this));
         Main.panel.menuManager.addMenu(this.menu);
 
         // At this moment applications menu is not keyboard navigable at
         // all (so not accessible), so it doesn't make sense to set as
         // role ATK_ROLE_MENU like other elements of the panel.
-        this.actor.accessible_role = Atk.Role.LABEL;
+        this.accessible_role = Atk.Role.LABEL;
 
         let hbox = new St.BoxLayout({ style_class: 'panel-status-menu-box' });
 
@@ -422,18 +422,17 @@ class ApplicationsButton extends PanelMenu.Button {
         hbox.add_child(this._label);
         hbox.add_child(PopupMenu.arrowIcon(St.Side.BOTTOM));
 
-        this.actor.add_actor(hbox);
-        this.actor.name = 'panelApplications';
-        this.actor.label_actor = this._label;
+        this.add_actor(hbox);
+        this.name = 'panelApplications';
+        this.label_actor = this._label;
 
-        this.actor.connect('captured-event', this._onCapturedEvent.bind(this));
-        this.actor.connect('destroy', this._onDestroy.bind(this));
+        this.connect('captured-event', this._onCapturedEvent.bind(this));
 
         this._showingId = Main.overview.connect('showing', () => {
-            this.actor.add_accessible_state (Atk.StateType.CHECKED);
+            this.add_accessible_state (Atk.StateType.CHECKED);
         });
         this._hidingId = Main.overview.connect('hiding', () => {
-            this.actor.remove_accessible_state (Atk.StateType.CHECKED);
+            this.remove_accessible_state (Atk.StateType.CHECKED);
         });
         Main.layoutManager.connect('startup-complete',
                                    this._setKeybinding.bind(this));


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]