messageTray: Rename the context menu to the tray menu

https://bugzilla.gnome.org/show_bug.cgi?id=699272
This commit is contained in:
Jasper St. Pierre 2013-04-19 12:00:44 -04:00
parent f5c0706c2e
commit 548111e2ff

View File

@ -1533,8 +1533,8 @@ const SummaryItem = new Lang.Class({
}); });
Signals.addSignalMethods(SummaryItem.prototype); Signals.addSignalMethods(SummaryItem.prototype);
const MessageTrayContextMenu = new Lang.Class({ const MessageTrayMenu = new Lang.Class({
Name: 'MessageTrayContextMenu', Name: 'MessageTrayMenu',
Extends: PopupMenu.PopupMenu, Extends: PopupMenu.PopupMenu,
_init: function(tray) { _init: function(tray) {
@ -1765,9 +1765,9 @@ const MessageTray = new Lang.Class({
this.actor.add_actor(this._noMessages); this.actor.add_actor(this._noMessages);
this._updateNoMessagesLabel(); this._updateNoMessagesLabel();
this._contextMenu = new MessageTrayContextMenu(this); this._trayMenu = new MessageTrayMenu(this);
this._contextMenuManager = new PopupMenu.PopupMenuManager({ actor: this.actor }); this._trayMenuManager = new PopupMenu.PopupMenuManager({ actor: this.actor });
this._contextMenuManager.addMenu(this._contextMenu); this._trayMenuManager.addMenu(this._trayMenu);
let clickAction = new Clutter.ClickAction(); let clickAction = new Clutter.ClickAction();
this.actor.add_action(clickAction); this.actor.add_action(clickAction);
@ -1775,7 +1775,7 @@ const MessageTray = new Lang.Class({
clickAction.connect('clicked', Lang.bind(this, function(action) { clickAction.connect('clicked', Lang.bind(this, function(action) {
let button = action.get_button(); let button = action.get_button();
if (button == 3) if (button == 3)
this._openContextMenu(); this._openTrayMenu();
})); }));
clickAction.connect('long-press', Lang.bind(this, function(action, actor, state) { clickAction.connect('long-press', Lang.bind(this, function(action, actor, state) {
@ -1783,16 +1783,16 @@ const MessageTray = new Lang.Class({
case Clutter.LongPressState.QUERY: case Clutter.LongPressState.QUERY:
return true; return true;
case Clutter.LongPressState.ACTIVATE: case Clutter.LongPressState.ACTIVATE:
this._openContextMenu(); this._openTrayMenu();
} }
return false; return false;
})); }));
}, },
_openContextMenu: function () { _openTrayMenu: function () {
let [x, y, mask] = global.get_pointer(); let [x, y, mask] = global.get_pointer();
this._contextMenu.setPosition(Math.round(x), Math.round(y)); this._trayMenu.setPosition(Math.round(x), Math.round(y));
this._contextMenu.open(BoxPointer.PopupAnimation.FULL); this._trayMenu.open(BoxPointer.PopupAnimation.FULL);
}, },
close: function() { close: function() {