PopupMenu: handle submenus inline

Instead of showing submenus on the left side, make PopupSubMenuMenuItem
act like an expander. The sub menu is toggled on click, opened on
right/enter/space on the parent item, closed on left on any item
or when closing the parent menu.

https://bugzilla.gnome.org/show_bug.cgi?id=633476
This commit is contained in:
Giovanni Campagna
2010-11-01 16:03:28 +01:00
parent 59b1aa26bb
commit 6024b87d27
3 changed files with 266 additions and 210 deletions

View File

@ -50,7 +50,7 @@ Button.prototype = {
if (open) {
this.actor.add_style_pseudo_class('pressed');
let focus = global.stage.get_key_focus();
if (!focus || (focus != this.actor && !menu.contains(focus)))
if (!focus || (focus != this.actor && !menu.actor.contains(focus)))
this.actor.grab_key_focus();
} else
this.actor.remove_style_pseudo_class('pressed');