[gnome-shell-extensions/wip/rstrode/heads-up-display: 19/62] places-menu: Don't hardcode position




commit 5d11663a1c992ea27a907cc4998466292fd64a51
Author: Florian Müllner <fmuellner gnome org>
Date:   Wed May 29 10:17:20 2019 +0000

    places-menu: Don't hardcode position
    
    The extension currently assumes that we have the "Activities" button
    at the left of the top bar. This is currently true, not only in the
    regular session, but also in GNOME classic where the button is hidden
    (but still present).
    
    However this is about to change: We will stop taking over the button
    from the apps-menu extension, and instead disable "Activities" from
    the session mode definition.
    
    Prepare for this by adding the places menu before the application menu
    instead of assuming a hardcoded position.
    
    https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/69

 extensions/places-menu/extension.js | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/extensions/places-menu/extension.js b/extensions/places-menu/extension.js
index c477a4a..5c038ae 100644
--- a/extensions/places-menu/extension.js
+++ b/extensions/places-menu/extension.js
@@ -135,9 +135,9 @@ let _indicator;
 function enable() {
     _indicator = new PlacesMenu;
 
-    let pos = 1;
+    let pos = Main.sessionMode.panel.left.indexOf('appMenu');
     if ('apps-menu' in Main.panel.statusArea)
-        pos = 2;
+        pos++;
     Main.panel.addToStatusArea('places-menu', _indicator, pos, 'left');
 }
 


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