messageTray: Split out the building of the right menu to a separate method
Besides code cleanliness, this allows us to stub out a right-click menu for resident sources. https://bugzilla.gnome.org/show_bug.cgi?id=683438
This commit is contained in:
@ -482,6 +482,22 @@ const ChatSource = new Lang.Class({
|
||||
this._getLogMessages();
|
||||
},
|
||||
|
||||
buildRightClickMenu: function() {
|
||||
let item;
|
||||
|
||||
let rightClickMenu = this.parent();
|
||||
item = new PopupMenu.PopupMenuItem('');
|
||||
item.actor.connect('notify::mapped', Lang.bind(this, function() {
|
||||
item.label.set_text(source.isMuted ? _("Unmute") : _("Mute"));
|
||||
}));
|
||||
item.connect('activate', Lang.bind(this, function() {
|
||||
this.setMuted(!this.isMuted);
|
||||
this.emit('done-displaying-content');
|
||||
}));
|
||||
rightClickMenu.add(item.actor);
|
||||
return rightClickMenu;
|
||||
},
|
||||
|
||||
_updateAlias: function() {
|
||||
let oldAlias = this.title;
|
||||
let newAlias = this._contact.get_alias();
|
||||
|
Reference in New Issue
Block a user