[gnome-shell] PanelMenuButton: set max-width every time the menu is opened



commit ff92d962f338d3376dee587f24127118caa7c886
Author: Giovanni Campagna <gcampagna src gnome org>
Date:   Tue Feb 28 19:09:56 2012 +0100

    PanelMenuButton: set max-width every time the menu is opened
    
    Previously, PanelMenuButton would only set max width if the user
    explicitly clicked the menu button, resulting in submenus without scrollbars
    if opened via keyboard navigation or mouse over.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=658946

 js/ui/panelMenu.js |   17 ++++++++---------
 1 files changed, 8 insertions(+), 9 deletions(-)
---
diff --git a/js/ui/panelMenu.js b/js/ui/panelMenu.js
index 6f15d2a..0b71c7c 100644
--- a/js/ui/panelMenu.js
+++ b/js/ui/panelMenu.js
@@ -147,15 +147,6 @@ const Button = new Lang.Class({
         if (!this.menu)
             return;
 
-        if (!this.menu.isOpen) {
-            // Setting the max-height won't do any good if the minimum height of the
-            // menu is higher then the screen; it's useful if part of the menu is
-            // scrollable so the minimum height is smaller than the natural height
-            let monitor = Main.layoutManager.primaryMonitor;
-            this.menu.actor.style = ('max-height: ' +
-                                     Math.round(monitor.height - Main.panel.actor.height) +
-                                     'px;');
-        }
         this.menu.toggle();
     },
 
@@ -198,6 +189,14 @@ const Button = new Lang.Class({
             this.actor.add_style_pseudo_class('active');
         else
             this.actor.remove_style_pseudo_class('active');
+
+        // Setting the max-height won't do any good if the minimum height of the
+        // menu is higher then the screen; it's useful if part of the menu is
+        // scrollable so the minimum height is smaller than the natural height
+        let monitor = Main.layoutManager.primaryMonitor;
+        this.menu.actor.style = ('max-height: ' +
+                                 Math.round(monitor.height - Main.panel.actor.height) +
+                                 'px;');
     },
 
     destroy: function() {



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