[gnome-shell/T27795: 39/138] systemMenu: Customize the system popup menu according to Endless' designs
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/T27795: 39/138] systemMenu: Customize the system popup menu according to Endless' designs
- Date: Tue, 1 Oct 2019 23:32:36 +0000 (UTC)
commit 40a8f8360ac82ca46f7af5082feb45119bb66425
Author: Mario Sanchez Prada <mario endlessm com>
Date: Thu May 4 18:55:14 2017 +0100
systemMenu: Customize the system popup menu according to Endless' designs
Reordered items in system indicator menu, removed the "system" section with
the settings/lock/power buttons and added a new "All Settingsā¦" menu item
on top, separated from the rest of the menu.
js/ui/panel.js | 25 ++++++++++++++++++++-----
1 file changed, 20 insertions(+), 5 deletions(-)
---
diff --git a/js/ui/panel.js b/js/ui/panel.js
index 28fdf2e1e5..7b0abdbc6f 100644
--- a/js/ui/panel.js
+++ b/js/ui/panel.js
@@ -5,6 +5,8 @@ const { Atk, Clutter, Gio, GLib, GObject, Meta, Shell, St } = imports.gi;
const Cairo = imports.cairo;
const Animation = imports.ui.animation;
+const AppActivation = imports.ui.appActivation;
+const BoxPointer = imports.ui.boxpointer;
const Config = imports.misc.config;
const CtrlAltTab = imports.ui.ctrlAltTab;
const DND = imports.ui.dnd;
@@ -19,6 +21,9 @@ var APP_MENU_ICON_MARGIN = 0;
var BUTTON_DND_ACTIVATION_TIMEOUT = 250;
+const SETTINGS_TEXT = _("All Settingsā¦");
+const CONTROL_CENTER_LAUNCHER = "gnome-control-center.desktop";
+
// To make sure the panel corners blend nicely with the panel,
// we draw background and borders the same way, e.g. drawing
// them as filled shapes from the outside inwards instead of
@@ -731,7 +736,6 @@ class AggregateMenu extends PanelMenu.Button {
this._rfkill = new imports.ui.status.rfkill.Indicator();
this._volume = new imports.ui.status.volume.Indicator();
this._brightness = new imports.ui.status.brightness.Indicator();
- this._system = new imports.ui.status.system.Indicator();
this._screencast = new imports.ui.status.screencast.Indicator();
this._location = new imports.ui.status.location.Indicator();
this._nightLight = new imports.ui.status.nightLight.Indicator();
@@ -754,8 +758,16 @@ class AggregateMenu extends PanelMenu.Button {
if (!userMode)
this._indicators.add_child(PopupMenu.arrowIcon(St.Side.BOTTOM));
- this.menu.addMenuItem(this._volume.menu);
- this.menu.addMenuItem(this._brightness.menu);
+ let gicon = new Gio.ThemedIcon({ name: 'applications-system-symbolic' });
+ this.menu.addAction(SETTINGS_TEXT, () => {
+ this.menu.close(BoxPointer.PopupAnimation.NONE);
+ Main.overview.hide();
+
+ let app = Shell.AppSystem.get_default().lookup_app(CONTROL_CENTER_LAUNCHER);
+ let context = new AppActivation.AppActivationContext(app);
+ context.activate();
+ }, gicon);
+
this.menu.addMenuItem(new PopupMenu.PopupSeparatorMenuItem());
if (this._network) {
this.menu.addMenuItem(this._network.menu);
@@ -768,12 +780,15 @@ class AggregateMenu extends PanelMenu.Button {
this.menu.addMenuItem(this._rfkill.menu);
this.menu.addMenuItem(this._power.menu);
this.menu.addMenuItem(this._nightLight.menu);
- this.menu.addMenuItem(this._system.menu);
+
+ this.menu.addMenuItem(new PopupMenu.PopupSeparatorMenuItem());
+
+ this.menu.addMenuItem(this._volume.menu);
+ this.menu.addMenuItem(this._brightness.menu);
menuLayout.addSizeChild(this._location.menu.actor);
menuLayout.addSizeChild(this._rfkill.menu.actor);
menuLayout.addSizeChild(this._power.menu.actor);
- menuLayout.addSizeChild(this._system.buttonGroup);
}
});
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]