userMenu: Update to latest mockups
Technically those are minor changes, but people will love us anyway: - change the default of the <alt>ernative to "Power Off" - remove "Online Accounts" item - regroup the remaining items - remove ellipses from labels https://bugzilla.gnome.org/show_bug.cgi?id=675802
This commit is contained in:
parent
518282e169
commit
afaa5c24d6
@ -582,14 +582,14 @@ const UserMenuButton = new Lang.Class({
|
|||||||
|
|
||||||
this._suspendOrPowerOffItem.actor.visible = this._haveShutdown || this._haveSuspend;
|
this._suspendOrPowerOffItem.actor.visible = this._haveShutdown || this._haveSuspend;
|
||||||
|
|
||||||
// If we can't suspend show Power Off... instead
|
// If we can't power off show Suspend instead
|
||||||
// and disable the alt key
|
// and disable the alt key
|
||||||
if (!this._haveSuspend) {
|
if (!this._haveShutdown) {
|
||||||
this._suspendOrPowerOffItem.updateText(_("Power Off..."), null);
|
|
||||||
} else if (!this._haveShutdown) {
|
|
||||||
this._suspendOrPowerOffItem.updateText(_("Suspend"), null);
|
this._suspendOrPowerOffItem.updateText(_("Suspend"), null);
|
||||||
|
} else if (!this._haveSuspend) {
|
||||||
|
this._suspendOrPowerOffItem.updateText(_("Power Off"), null);
|
||||||
} else {
|
} else {
|
||||||
this._suspendOrPowerOffItem.updateText(_("Suspend"), _("Power Off..."));
|
this._suspendOrPowerOffItem.updateText(_("Power Off"), _("Suspend"));
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -629,28 +629,26 @@ const UserMenuButton = new Lang.Class({
|
|||||||
item = new PopupMenu.PopupSeparatorMenuItem();
|
item = new PopupMenu.PopupSeparatorMenuItem();
|
||||||
this.menu.addMenuItem(item);
|
this.menu.addMenuItem(item);
|
||||||
|
|
||||||
item = new PopupMenu.PopupMenuItem(_("Online Accounts"));
|
|
||||||
item.connect('activate', Lang.bind(this, this._onOnlineAccountsActivate));
|
|
||||||
this.menu.addMenuItem(item);
|
|
||||||
|
|
||||||
item = new PopupMenu.PopupMenuItem(_("System Settings"));
|
item = new PopupMenu.PopupMenuItem(_("System Settings"));
|
||||||
item.connect('activate', Lang.bind(this, this._onPreferencesActivate));
|
item.connect('activate', Lang.bind(this, this._onPreferencesActivate));
|
||||||
this.menu.addMenuItem(item);
|
this.menu.addMenuItem(item);
|
||||||
|
|
||||||
|
item = new PopupMenu.PopupAlternatingMenuItem(_("Power Off"),
|
||||||
|
_("Suspend"));
|
||||||
|
this.menu.addMenuItem(item);
|
||||||
|
item.connect('activate', Lang.bind(this, this._onSuspendOrPowerOffActivate));
|
||||||
|
this._suspendOrPowerOffItem = item;
|
||||||
|
this._updateSuspendOrPowerOff();
|
||||||
|
|
||||||
item = new PopupMenu.PopupSeparatorMenuItem();
|
item = new PopupMenu.PopupSeparatorMenuItem();
|
||||||
this.menu.addMenuItem(item);
|
this.menu.addMenuItem(item);
|
||||||
|
|
||||||
item = new PopupMenu.PopupMenuItem(_("Lock Screen"));
|
|
||||||
item.connect('activate', Lang.bind(this, this._onLockScreenActivate));
|
|
||||||
this.menu.addMenuItem(item);
|
|
||||||
this._lockScreenItem = item;
|
|
||||||
|
|
||||||
item = new PopupMenu.PopupMenuItem(_("Switch User"));
|
item = new PopupMenu.PopupMenuItem(_("Switch User"));
|
||||||
item.connect('activate', Lang.bind(this, this._onLoginScreenActivate));
|
item.connect('activate', Lang.bind(this, this._onLoginScreenActivate));
|
||||||
this.menu.addMenuItem(item);
|
this.menu.addMenuItem(item);
|
||||||
this._loginScreenItem = item;
|
this._loginScreenItem = item;
|
||||||
|
|
||||||
item = new PopupMenu.PopupMenuItem(_("Log Out..."));
|
item = new PopupMenu.PopupMenuItem(_("Log Out"));
|
||||||
item.connect('activate', Lang.bind(this, this._onQuitSessionActivate));
|
item.connect('activate', Lang.bind(this, this._onQuitSessionActivate));
|
||||||
this.menu.addMenuItem(item);
|
this.menu.addMenuItem(item);
|
||||||
this._logoutItem = item;
|
this._logoutItem = item;
|
||||||
@ -658,12 +656,10 @@ const UserMenuButton = new Lang.Class({
|
|||||||
item = new PopupMenu.PopupSeparatorMenuItem();
|
item = new PopupMenu.PopupSeparatorMenuItem();
|
||||||
this.menu.addMenuItem(item);
|
this.menu.addMenuItem(item);
|
||||||
|
|
||||||
item = new PopupMenu.PopupAlternatingMenuItem(_("Suspend"),
|
item = new PopupMenu.PopupMenuItem(_("Lock"));
|
||||||
_("Power Off..."));
|
item.connect('activate', Lang.bind(this, this._onLockScreenActivate));
|
||||||
this.menu.addMenuItem(item);
|
this.menu.addMenuItem(item);
|
||||||
this._suspendOrPowerOffItem = item;
|
this._lockScreenItem = item;
|
||||||
item.connect('activate', Lang.bind(this, this._onSuspendOrPowerOffActivate));
|
|
||||||
this._updateSuspendOrPowerOff();
|
|
||||||
},
|
},
|
||||||
|
|
||||||
_updatePresenceStatus: function(item, event) {
|
_updatePresenceStatus: function(item, event) {
|
||||||
@ -691,12 +687,6 @@ const UserMenuButton = new Lang.Class({
|
|||||||
app.activate();
|
app.activate();
|
||||||
},
|
},
|
||||||
|
|
||||||
_onOnlineAccountsActivate: function() {
|
|
||||||
Main.overview.hide();
|
|
||||||
let app = Shell.AppSystem.get_default().lookup_setting('gnome-online-accounts-panel.desktop');
|
|
||||||
app.activate(-1);
|
|
||||||
},
|
|
||||||
|
|
||||||
_onPreferencesActivate: function() {
|
_onPreferencesActivate: function() {
|
||||||
Main.overview.hide();
|
Main.overview.hide();
|
||||||
let app = Shell.AppSystem.get_default().lookup_app('gnome-control-center.desktop');
|
let app = Shell.AppSystem.get_default().lookup_app('gnome-control-center.desktop');
|
||||||
@ -725,14 +715,14 @@ const UserMenuButton = new Lang.Class({
|
|||||||
_onSuspendOrPowerOffActivate: function() {
|
_onSuspendOrPowerOffActivate: function() {
|
||||||
Main.overview.hide();
|
Main.overview.hide();
|
||||||
|
|
||||||
if (this._haveSuspend &&
|
if (this._haveShutdown &&
|
||||||
this._suspendOrPowerOffItem.state == PopupMenu.PopupAlternatingMenuItemState.DEFAULT) {
|
this._suspendOrPowerOffItem.state == PopupMenu.PopupAlternatingMenuItemState.DEFAULT) {
|
||||||
|
this._session.ShutdownRemote();
|
||||||
|
} else {
|
||||||
// Ensure we only suspend after locking the screen
|
// Ensure we only suspend after locking the screen
|
||||||
this._screenSaverProxy.LockRemote(Lang.bind(this, function() {
|
this._screenSaverProxy.LockRemote(Lang.bind(this, function() {
|
||||||
this._upClient.suspend_sync(null);
|
this._upClient.suspend_sync(null);
|
||||||
}));
|
}));
|
||||||
} else {
|
|
||||||
this._session.ShutdownRemote();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user