PopupSwitchMenuItem: allow toggling without closing the menu
Similar to what Gtk does, now toggling with Space does not close the menu. https://bugzilla.gnome.org/show_bug.cgi?id=664416
This commit is contained in:
parent
5c730dc53d
commit
ee6bc33cea
@ -774,6 +774,12 @@ const PopupSwitchMenuItem = new Lang.Class({
|
|||||||
this.toggle();
|
this.toggle();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// we allow pressing space to toggle the switch
|
||||||
|
// without closing the menu
|
||||||
|
if (event.type() == Clutter.EventType.KEY_PRESS &&
|
||||||
|
event.get_key_symbol() == Clutter.KEY_space)
|
||||||
|
return;
|
||||||
|
|
||||||
this.parent(event);
|
this.parent(event);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -613,7 +613,7 @@ const UserMenuButton = new Lang.Class({
|
|||||||
this._statusChooser = item;
|
this._statusChooser = item;
|
||||||
|
|
||||||
item = new PopupMenu.PopupSwitchMenuItem(_("Notifications"));
|
item = new PopupMenu.PopupSwitchMenuItem(_("Notifications"));
|
||||||
item.connect('activate', Lang.bind(this, this._updatePresenceStatus));
|
item.connect('toggled', Lang.bind(this, this._updatePresenceStatus));
|
||||||
this.menu.addMenuItem(item);
|
this.menu.addMenuItem(item);
|
||||||
this._notificationsSwitch = item;
|
this._notificationsSwitch = item;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user