diff --git a/Settings.ui b/Settings.ui index e5abc35..9220728 100644 --- a/Settings.ui +++ b/Settings.ui @@ -784,6 +784,50 @@ + + + 100 + True + True + + + True + False + 12 + 12 + 12 + 12 + 32 + + + True + True + end + center + + + 1 + 0 + + + + + True + False + True + Show AppMenu + True + 0 + + + 0 + 0 + + + + + + 100 diff --git a/panel.js b/panel.js index 6d5364e..4d6397b 100644 --- a/panel.js +++ b/panel.js @@ -94,6 +94,7 @@ const dtpPanel = new Lang.Class({ this._panelConnectId = this.panel.actor.connect('allocate', Lang.bind(this, function(actor,box,flags){this._allocate(actor,box,flags);})); this.container.remove_child(this.appMenu.container); + this.panel._rightBox.insert_child_at_index(this.appMenu.container, 0); this.taskbar = new Taskbar.taskbar(this._dtpSettings); Main.overview.dashIconSize = this.taskbar.iconSize; @@ -103,6 +104,7 @@ const dtpPanel = new Lang.Class({ this._oldCenterBoxStyle = this.panel._centerBox.get_style(); this._oldRightBoxStyle = this.panel._rightBox.get_style(); this._setActivitiesButtonVisible(this._dtpSettings.get_boolean('show-activities-button')); + this._setAppmenuVisible(this._dtpSettings.get_boolean('show-appmenu')); this._setClockLocation(this._dtpSettings.get_string('location-clock')); this.panel.actor.add_style_class_name('dashtopanelMainPanel'); @@ -165,6 +167,8 @@ const dtpPanel = new Lang.Class({ this._signalsHandler.destroy(); this.container.remove_child(this.taskbar.actor); + this._setAppmenuVisible(true); + this.panel._rightBox.remove_child(this.appMenu.container); this.container.add_child(this.appMenu.container); this.taskbar.destroy(); this.panel.actor.disconnect(this._panelConnectId); @@ -210,6 +214,10 @@ const dtpPanel = new Lang.Class({ this._dtpSettings.connect('changed::show-activities-button', Lang.bind(this, function() { this._setActivitiesButtonVisible(this._dtpSettings.get_boolean('show-activities-button')); })); + + this._dtpSettings.connect('changed::show-appmenu', Lang.bind(this, function() { + this._setAppmenuVisible(this._dtpSettings.get_boolean('show-appmenu')); + })); this._dtpSettings.connect('changed::location-clock', Lang.bind(this, function() { this._setClockLocation(this._dtpSettings.get_string('location-clock')); @@ -319,6 +327,12 @@ const dtpPanel = new Lang.Class({ isVisible ? this.panel.statusArea.activities.actor.show() : this.panel.statusArea.activities.actor.hide(); }, + + _setAppmenuVisible: function(isVisible) { + if(this.appMenu) + isVisible ? this.appMenu.actor.show() : + this.appMenu.actor.hide(); + }, _setClockLocation: function(loc) { let centerBox = this.panel._centerBox; @@ -355,4 +369,4 @@ const dtpPanel = new Lang.Class({ } } -}); \ No newline at end of file +}); diff --git a/prefs.js b/prefs.js index df2470b..cfce1a9 100644 --- a/prefs.js +++ b/prefs.js @@ -147,6 +147,10 @@ const Settings = new Lang.Class({ this._builder.get_object('show_activities_button_switch'), 'active', Gio.SettingsBindFlags.DEFAULT); + this._settings.bind('show-appmenu', + this._builder.get_object('show_appmenu_switch'), + 'active', + Gio.SettingsBindFlags.DEFAULT); this._settings.bind('show-window-previews', this._builder.get_object('show_window_previews_switch'), 'active', diff --git a/schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml b/schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml index 404042c..0711e95 100644 --- a/schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml +++ b/schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml @@ -59,6 +59,11 @@ Show activities button Show activities button on the left hand side of the taskbar + + false + Show appMenu + Show appMenu on the right hand side of the panel + true Show window preview