diff --git a/Settings.ui b/Settings.ui index 10e1756..96a4768 100644 --- a/Settings.ui +++ b/Settings.ui @@ -2956,6 +2956,11 @@ + + 100 + 1 + 10 + True False @@ -3039,6 +3044,56 @@ 0 + + + True + True + + + True + False + 12 + 12 + 12 + 12 + True + 6 + 32 + + + True + True + end + 0 + show_applications_side_padding_adjustment + + + 1 + 0 + + + + + True + False + True + Show Applications icon side padding (px) + 0 + + + 0 + 0 + + + + + + + False + True + 1 + + 1 diff --git a/appIcons.js b/appIcons.js index ee354d1..c9c69af 100644 --- a/appIcons.js +++ b/appIcons.js @@ -1503,10 +1503,22 @@ var ShowAppsIconWrapper = new Lang.Class({ return this._iconActor; }; - this._dtpSettings.connect('changed::show-apps-icon-file', () => { + this._changedShowAppsIconId = this._dtpSettings.connect('changed::show-apps-icon-file', () => { customIconPath = this._dtpSettings.get_string('show-apps-icon-file'); this.realShowAppsIcon.icon._createIconTexture(this.realShowAppsIcon.icon.iconSize); }); + + this._changedAppIconPaddingId = this._dtpSettings.connect('changed::appicon-padding', () => this.setShowAppsPadding()); + this._changedAppIconSidePaddingId = this._dtpSettings.connect('changed::show-apps-icon-side-padding', () => this.setShowAppsPadding()); + + this.setShowAppsPadding(); + }, + + setShowAppsPadding: function() { + let padding = this._dtpSettings.get_int('appicon-padding'); + let sidePadding = this._dtpSettings.get_int('show-apps-icon-side-padding') + + this.actor.set_style('padding:' + padding + 'px ' + (padding + sidePadding) + 'px;'); }, popupMenu: function() { @@ -1540,6 +1552,12 @@ var ShowAppsIconWrapper = new Lang.Class({ shouldShowTooltip: function() { return this.actor.hover && (!this._menu || !this._menu.isOpen); + }, + + destroy: function() { + this._dtpSettings.disconnect(this._changedShowAppsIconId); + this._dtpSettings.disconnect(this._changedAppIconSidePaddingId); + this._dtpSettings.disconnect(this._changedAppIconPaddingId); } }); Signals.addSignalMethods(ShowAppsIconWrapper.prototype); diff --git a/prefs.js b/prefs.js index 9eae1fe..e9d5af2 100644 --- a/prefs.js +++ b/prefs.js @@ -780,6 +780,11 @@ const Settings = new Lang.Class({ this._builder.get_object('show_application_options_button'), 'sensitive', Gio.SettingsBindFlags.DEFAULT); + + this._builder.get_object('show_applications_side_padding_spinbutton').set_value(this._settings.get_int('show-apps-icon-side-padding')); + this._builder.get_object('show_applications_side_padding_spinbutton').connect('value-changed', Lang.bind (this, function(widget) { + this._settings.set_int('show-apps-icon-side-padding', widget.get_value()); + })); this._builder.get_object('show_application_options_button').connect('clicked', Lang.bind(this, function() { let dialog = new Gtk.Dialog({ title: _('Show Applications options'), @@ -823,6 +828,8 @@ const Settings = new Lang.Class({ dialog.connect('response', Lang.bind(this, function(dialog, id) { if (id == 1) { // restore default settings + this._settings.set_value('show-apps-icon-side-padding', this._settings.get_default_value('show-apps-icon-side-padding')); + this._builder.get_object('show_applications_side_padding_spinbutton').set_value(this._settings.get_int('show-apps-icon-side-padding')); handleIconChange.call(this, null); } else { // remove the settings box so it doesn't get destroyed; 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 fec726c..cbdfdb5 100644 --- a/schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml +++ b/schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml @@ -315,6 +315,11 @@ Custom Show Applications icon Customize the Show Applications icon + + 8 + Show Applications icon side padding + Customize the Show Applications icon side padding + true Animate Show Applications from the desktop diff --git a/stylesheet.css b/stylesheet.css index 2088046..1425c97 100644 --- a/stylesheet.css +++ b/stylesheet.css @@ -32,10 +32,6 @@ padding: 0 4px; } -#dashtopanelTaskbar .show-apps { - padding: 0 8px; -} - #dashtopanelScrollview .app-well-app .overview-label { padding-right: 8px; } diff --git a/taskbar.js b/taskbar.js index 720dce3..e81ad89 100644 --- a/taskbar.js +++ b/taskbar.js @@ -370,6 +370,7 @@ var taskbar = new Lang.Class({ destroy: function() { this._signalsHandler.destroy(); this._signalsHandler = 0; + this._showAppsIconWrapper.destroy(); this._container.destroy(); this._disconnectWorkspaceSignals();