From e6153bb578187e92b1ef221bcc172e2816c382b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Wed, 1 Jul 2020 17:18:16 +0200 Subject: [PATCH] status/system: Swap power- and user-related items in session menu Quoting Allan: "It's been niggling me that log out is closest to hand, as opposed to suspend" https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2202 --- js/ui/status/system.js | 52 +++++++++++++++++++++--------------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/js/ui/status/system.js b/js/ui/status/system.js index 3feb9ac85..c5673913e 100644 --- a/js/ui/status/system.js +++ b/js/ui/status/system.js @@ -113,31 +113,7 @@ class Indicator extends PanelMenu.SystemIndicator { _('Power Off / Log Out'), true); this._sessionSubMenu.icon.icon_name = 'system-shutdown-symbolic'; - item = new PopupMenu.PopupMenuItem(_("Log Out")); - item.connect('activate', () => { - this.menu.itemActivated(BoxPointer.PopupAnimation.NONE); - this._systemActions.activateLogout(); - }); - this._sessionSubMenu.menu.addMenuItem(item); - this._logoutItem = item; - this._systemActions.bind_property('can-logout', - this._logoutItem, 'visible', - bindFlags); - - item = new PopupMenu.PopupMenuItem(_("Switch User…")); - item.connect('activate', () => { - this.menu.itemActivated(BoxPointer.PopupAnimation.NONE); - this._systemActions.activateSwitchUser(); - }); - this._sessionSubMenu.menu.addMenuItem(item); - this._loginScreenItem = item; - this._systemActions.bind_property('can-switch-user', - this._loginScreenItem, 'visible', - bindFlags); - - this._sessionSubMenu.menu.addMenuItem(new PopupMenu.PopupSeparatorMenuItem()); - - item = new PopupMenu.PopupMenuItem(_("Suspend")); + item = new PopupMenu.PopupMenuItem(_('Suspend')); item.connect('activate', () => { this.menu.itemActivated(BoxPointer.PopupAnimation.NONE); this._systemActions.activateSuspend(); @@ -148,7 +124,7 @@ class Indicator extends PanelMenu.SystemIndicator { this._suspendItem, 'visible', bindFlags); - item = new PopupMenu.PopupMenuItem(_("Power Off…")); + item = new PopupMenu.PopupMenuItem(_('Power Off…')); item.connect('activate', () => { this.menu.itemActivated(BoxPointer.PopupAnimation.NONE); this._systemActions.activatePowerOff(); @@ -159,6 +135,30 @@ class Indicator extends PanelMenu.SystemIndicator { this._powerOffItem, 'visible', bindFlags); + this._sessionSubMenu.menu.addMenuItem(new PopupMenu.PopupSeparatorMenuItem()); + + item = new PopupMenu.PopupMenuItem(_('Log Out')); + item.connect('activate', () => { + this.menu.itemActivated(BoxPointer.PopupAnimation.NONE); + this._systemActions.activateLogout(); + }); + this._sessionSubMenu.menu.addMenuItem(item); + this._logoutItem = item; + this._systemActions.bind_property('can-logout', + this._logoutItem, 'visible', + bindFlags); + + item = new PopupMenu.PopupMenuItem(_('Switch User…')); + item.connect('activate', () => { + this.menu.itemActivated(BoxPointer.PopupAnimation.NONE); + this._systemActions.activateSwitchUser(); + }); + this._sessionSubMenu.menu.addMenuItem(item); + this._loginScreenItem = item; + this._systemActions.bind_property('can-switch-user', + this._loginScreenItem, 'visible', + bindFlags); + this.menu.addMenuItem(this._sessionSubMenu); } });