popupMenu: make submenus scrollable if needed
Right now, the network menu will overflow the screen if More... is selected with many access points. As a short-term workaround for this, add a scrollbar for submenus of panel dropdown menus if they would cause the toplevel menu to overflow the screen. - Put the actors in a PopupSubMenu in a StScrollView so we get a scrollbar if the allocated space is smaller than the height of the menu. Expand animation is turned off in the scrolled case to avoid weirdness. - When we pop up a panel menu, set a max-height style property on the panel menu to limit it to the height of the screen. - Hack event handling while the scrollbar is dragged to make the scrollbar work properly. https://bugzilla.gnome.org/show_bug.cgi?id=646001
This commit is contained in:
@ -32,6 +32,15 @@ Button.prototype = {
|
||||
},
|
||||
|
||||
_onButtonPress: function(actor, event) {
|
||||
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 = global.get_primary_monitor();
|
||||
this.menu.actor.style = ('max-height: ' +
|
||||
Math.round(monitor.height - Main.panel.actor.height) +
|
||||
'px;');
|
||||
}
|
||||
this.menu.toggle();
|
||||
},
|
||||
|
||||
|
Reference in New Issue
Block a user