[gnome-shell] PopupMenu: propagate all open-state-changed down to PopupMenuSection
- From: Giovanni Campagna <gcampagna src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] PopupMenu: propagate all open-state-changed down to PopupMenuSection
- Date: Wed, 29 Aug 2012 23:48:29 +0000 (UTC)
commit 04d1a35cb56d9794602fe4a16ea29f8ac7e36439
Author: Giovanni Campagna <gcampagna src gnome org>
Date: Thu Aug 30 00:11:05 2012 +0200
PopupMenu: propagate all open-state-changed down to PopupMenuSection
PopupMenuBase relies on open-state-changed to update the separator
visibility, but PopupMenuSection were only emitting when the parent
closed, so the first time the menu was opened, separator visiblity was
wrong.
https://bugzilla.gnome.org/show_bug.cgi?id=682998
js/ui/popupMenu.js | 11 +++++++----
1 files changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/js/ui/popupMenu.js b/js/ui/popupMenu.js
index 70c4360..cb3f05d 100644
--- a/js/ui/popupMenu.js
+++ b/js/ui/popupMenu.js
@@ -1052,14 +1052,17 @@ const PopupMenuBase = new Lang.Class({
if (menuItem instanceof PopupMenuSection) {
this._connectSubMenuSignals(menuItem, menuItem);
- menuItem._closingId = this.connect('open-state-changed',
+ menuItem._parentOpenStateChangedId = this.connect('open-state-changed',
function(self, open) {
- if (!open)
- menuItem.close(BoxPointer.PopupAnimation.FADE);
+ if (open)
+ menuItem.open();
+ else
+ menuItem.close();
});
menuItem.connect('destroy', Lang.bind(this, function() {
menuItem.disconnect(menuItem._subMenuActivateId);
menuItem.disconnect(menuItem._subMenuActiveChangeId);
+ this.disconnect(menuItem._parentOpenStateChangedId);
this.length--;
}));
@@ -1440,7 +1443,7 @@ const PopupMenuSection = new Lang.Class({
// deliberately ignore any attempt to open() or close(), but emit the
// corresponding signal so children can still pick it up
- open: function(animate) { this.emit('open-state-changed', true); },
+ open: function() { this.emit('open-state-changed', true); },
close: function() { this.emit('open-state-changed', false); },
destroy: function() {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]