[gnome-shell] PopupSwitchMenuItem: allow toggling without closing the menu
- From: Giovanni Campagna <gcampagna src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] PopupSwitchMenuItem: allow toggling without closing the menu
- Date: Mon, 6 Feb 2012 15:49:31 +0000 (UTC)
commit ee6bc33ceaa06d73d78e2ebdacaadddc7438e579
Author: Giovanni Campagna <gcampagna src gnome org>
Date: Mon Nov 21 14:16:51 2011 +0100
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
js/ui/popupMenu.js | 6 ++++++
js/ui/userMenu.js | 2 +-
2 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/js/ui/popupMenu.js b/js/ui/popupMenu.js
index aca4ae3..58ca000 100644
--- a/js/ui/popupMenu.js
+++ b/js/ui/popupMenu.js
@@ -774,6 +774,12 @@ const PopupSwitchMenuItem = new Lang.Class({
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);
},
diff --git a/js/ui/userMenu.js b/js/ui/userMenu.js
index 7862477..6c7de8e 100644
--- a/js/ui/userMenu.js
+++ b/js/ui/userMenu.js
@@ -613,7 +613,7 @@ const UserMenuButton = new Lang.Class({
this._statusChooser = item;
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._notificationsSwitch = item;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]