MessageTray: don't close the tray when interacting with the right click menu

If the chosen action is not open, the tray should not be closed, to
let the user further interact with it (for example to mute or remove
more sources)

https://bugzilla.gnome.org/show_bug.cgi?id=689296
This commit is contained in:
Giovanni Campagna 2012-11-30 16:14:50 +01:00
parent 41f933b89e
commit 961dba7faa
2 changed files with 14 additions and 5 deletions

View File

@ -478,7 +478,7 @@ const ChatSource = new Lang.Class({
}));
item.connect('activate', Lang.bind(this, function() {
this.setMuted(!this.isMuted);
this.emit('done-displaying-content');
this.emit('done-displaying-content', false);
}));
rightClickMenu.add(item.actor);
return rightClickMenu;

View File

@ -1088,14 +1088,14 @@ const Source = new Lang.Class({
item = new PopupMenu.PopupMenuItem(_("Open"));
item.connect('activate', Lang.bind(this, function() {
this.open();
this.emit('done-displaying-content');
this.emit('done-displaying-content', true);
}));
rightClickMenu.add(item.actor);
item = new PopupMenu.PopupMenuItem(_("Remove"));
item.connect('activate', Lang.bind(this, function() {
this.destroy();
this.emit('done-displaying-content');
this.emit('done-displaying-content', false);
}));
rightClickMenu.add(item.actor);
return rightClickMenu;
@ -1341,7 +1341,7 @@ const SummaryItem = new Lang.Class({
},
_notificationDoneDisplaying: function() {
this.source.emit('done-displaying-content');
this.source.emit('done-displaying-content', true);
},
_notificationDestroyed: function(notification) {
@ -2454,12 +2454,21 @@ const MessageTray = new Lang.Class({
});
},
_onSourceDoneDisplayingContent: function(source, closeTray) {
if (closeTray) {
this._escapeTray();
} else {
this._setClickedSummaryItem(null);
this._updateState();
}
},
_showSummaryBoxPointer: function() {
this._summaryBoxPointerItem = this._clickedSummaryItem;
this._summaryBoxPointerContentUpdatedId = this._summaryBoxPointerItem.connect('content-updated',
Lang.bind(this, this._onSummaryBoxPointerContentUpdated));
this._sourceDoneDisplayingId = this._summaryBoxPointerItem.source.connect('done-displaying-content',
Lang.bind(this, this._escapeTray));
Lang.bind(this, this._onSourceDoneDisplayingContent));
let hasRightClickMenu = this._summaryBoxPointerItem.rightClickMenu != null;
if (this._clickedSummaryItemMouseButton == 1 || !hasRightClickMenu) {