mirror of
https://github.com/edu4rdshl/gnome-shell.git
synced 2026-07-18 07:34:54 +00:00
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
This commit is contained in:
parent
79ca0d579c
commit
ff92d962f3
1 changed files with 8 additions and 9 deletions
|
|
@ -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() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue