[gnome-shell-extensions/gnome-40] drive-menu: Hide items initially



commit 15c83db79379532b72df1989463fc102a90fdfc2
Author: Florian Müllner <fmuellner gnome org>
Date:   Tue Jul 13 11:54:21 2021 +0200

    drive-menu: Hide items initially
    
    Now that the check for network mounts is non-blocking, the initial
    sync doesn't take effect immediately. We don't want hidden items
    to briefly flash the indicator, so create them initially hidden.
    
    Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/176>

 extensions/drive-menu/extension.js | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/extensions/drive-menu/extension.js b/extensions/drive-menu/extension.js
index 6c6fd76..f60dab7 100644
--- a/extensions/drive-menu/extension.js
+++ b/extensions/drive-menu/extension.js
@@ -41,6 +41,8 @@ class MountMenuItem extends PopupMenu.PopupBaseMenuItem {
         ejectButton.connect('clicked', this._eject.bind(this));
         this.add(ejectButton);
 
+        this.hide();
+
         this._changedId = mount.connect('changed', this._syncVisibility.bind(this));
         this._syncVisibility();
     }
@@ -155,10 +157,8 @@ class DriveMenu extends PanelMenu.Button {
         this.add_child(icon);
 
         this._monitor = Gio.VolumeMonitor.get();
-        this._addedId = this._monitor.connect('mount-added', (monitor, mount) => {
-            this._addMount(mount);
-            this._updateMenuVisibility();
-        });
+        this._addedId = this._monitor.connect('mount-added',
+            (monitor, mount) => this._addMount(mount));
         this._removedId = this._monitor.connect('mount-removed', (monitor, mount) => {
             this._removeMount(mount);
             this._updateMenuVisibility();


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