[gnome-shell/wip/aggregate-menu: 65/99] popupMenu: Don't animate submenus closing when closing the menu



commit ad5c669d539d7cccc913bc0d84680e693f9f7bd9
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Tue Jun 11 18:33:30 2013 -0400

    popupMenu: Don't animate submenus closing when closing the menu
    
    It looks distracting.

 js/ui/popupMenu.js |   16 +++++++++++-----
 1 files changed, 11 insertions(+), 5 deletions(-)
---
diff --git a/js/ui/popupMenu.js b/js/ui/popupMenu.js
index c949fc9..eea631c 100644
--- a/js/ui/popupMenu.js
+++ b/js/ui/popupMenu.js
@@ -878,10 +878,14 @@ const PopupMenuBase = new Lang.Class({
                     else
                         menuItem.close();
                 });
+            menuItem._parentClosingId = this.connect('menu-closed', function() {
+                menuItem.emit('menu-closed');
+            });
             menuItem.connect('destroy', Lang.bind(this, function() {
                 menuItem.disconnect(menuItem._subMenuActivateId);
                 menuItem.disconnect(menuItem._subMenuActiveChangeId);
                 this.disconnect(menuItem._parentOpenStateChangedId);
+                this.disconnect(menuItem._parentClosingId);
 
                 this.length--;
             }));
@@ -892,9 +896,8 @@ const PopupMenuBase = new Lang.Class({
                 this.box.insert_child_below(menuItem.menu.actor, before_item);
             this._connectSubMenuSignals(menuItem, menuItem.menu);
             this._connectItemSignals(menuItem);
-            menuItem._closingId = this.connect('open-state-changed', function(self, open) {
-                if (!open)
-                    menuItem.menu.close(BoxPointer.PopupAnimation.FADE);
+            menuItem._closingId = this.connect('menu-closed', function() {
+                menuItem.menu.close(BoxPointer.PopupAnimation.NONE);
             });
         } else if (menuItem instanceof PopupSeparatorMenuItem) {
             this._connectItemSignals(menuItem);
@@ -1083,8 +1086,11 @@ const PopupMenu = new Lang.Class({
         if (this._activeMenuItem)
             this._activeMenuItem.setActive(false);
 
-        if (this._boxPointer.actor.visible)
-            this._boxPointer.hide(animate);
+        if (this._boxPointer.actor.visible) {
+            this._boxPointer.hide(animate, Lang.bind(this, function() {
+                this.emit('menu-closed');
+            }));
+        }
 
         if (!this.isOpen)
             return;


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