diff --git a/appIcons.js b/appIcons.js index 44cdd3e..7abdb4e 100644 --- a/appIcons.js +++ b/appIcons.js @@ -1429,6 +1429,7 @@ var ShowAppsIconWrapper = new Lang.Class({ /* the variable equivalent to toggleButton has a different name in the appIcon class (actor): duplicate reference to easily reuse appIcon methods */ this.actor = this.realShowAppsIcon.toggleButton; + this.actor.name = 'show-apps-btn'; // Re-use appIcon methods this._removeMenuTimeout = AppDisplay.AppIcon.prototype._removeMenuTimeout; @@ -1475,6 +1476,13 @@ var ShowAppsIconWrapper = new Lang.Class({ customIconPath = this._dtpSettings.get_string('show-apps-icon-file'); this.realShowAppsIcon.icon._createIconTexture(this.realShowAppsIcon.icon.iconSize); }); + + this._dtpSettings.connect('changed::appicon-padding', () => this.setShowAppsPadding()); + this.setShowAppsPadding(); + }, + + setShowAppsPadding: function() { + this.actor.set_style('padding:' + (this._dtpSettings.get_int('appicon-padding') + 2) + 'px;'); }, popupMenu: function() { diff --git a/panel.js b/panel.js index b59b9bd..868bb9b 100644 --- a/panel.js +++ b/panel.js @@ -31,6 +31,7 @@ const Me = imports.misc.extensionUtils.getCurrentExtension(); const Clutter = imports.gi.Clutter; const Config = imports.misc.config; const Gtk = imports.gi.Gtk; +const Gi = imports._gi; const Utils = Me.imports.utils; const Taskbar = Me.imports.taskbar; const PanelStyle = Me.imports.panelStyle; @@ -123,17 +124,26 @@ var dtpPanelWrapper = new Lang.Class({ this.oldRightBoxAllocate(box, flags); }); - this._panelConnectId = this.panel.actor.connect('allocate', Lang.bind(this, function(actor,box,flags){this._allocate(actor,box,flags);})); + if (this.panel.vfunc_allocate) { + this._panelConnectId = 0; + this._oldAllocate = this.panel.__proto__.vfunc_allocate; + this.panel.__proto__[Gi.hook_up_vfunc_symbol]('allocate', (box, flags) => { + //panel inherits from St.Widget, invoke its parent allocation + St.Widget.prototype.vfunc_allocate.call(this.panel, box, flags); + this._allocate(null, box, flags); + }); + } else { + this._panelConnectId = this.panel.actor.connect('allocate', (actor,box,flags) => this._allocate(actor,box,flags)); + } + if(this.appMenu) this.panel._leftBox.remove_child(this.appMenu.container); + this.taskbar = new Taskbar.taskbar(this._dtpSettings, this); Main.overview.dashIconSize = this.taskbar.iconSize; this.container.insert_child_at_index( this.taskbar.actor, 2 ); - this._oldLeftBoxStyle = this.panel._leftBox.get_style(); - 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')); @@ -265,7 +275,12 @@ var dtpPanelWrapper = new Lang.Class({ if(this.appMenu) this.panel._leftBox.add_child(this.appMenu.container); this.taskbar.destroy(); - this.panel.actor.disconnect(this._panelConnectId); + + if (this._panelConnectId) { + this.panel.actor.disconnect(this._panelConnectId); + } else if (this._oldAllocate) { + this.panel.__proto__[Gi.hook_up_vfunc_symbol]('allocate', this._oldAllocate); + } if (this.startIntellihideId) { Mainloop.source_remove(this.startIntellihideId); diff --git a/panelManager.js b/panelManager.js index ae0fac4..0f501c0 100644 --- a/panelManager.js +++ b/panelManager.js @@ -244,7 +244,7 @@ function newPopupOpen(animate) { } this._boxPointer.setPosition(this.sourceActor, this._arrowAlignment); - this._boxPointer.show(animate); + (this._boxPointer.open || this._boxPointer.show).call(this._boxPointer, animate); this.actor.raise_top(); diff --git a/stylesheet.css b/stylesheet.css index fe3db8d..af91b98 100644 --- a/stylesheet.css +++ b/stylesheet.css @@ -24,12 +24,18 @@ #dashtopanelScrollview .app-well-app .overview-icon { border-radius: 0; border: none; + padding: 2px; } #dashtopanelScrollview .app-well-app .overview-label { padding-right: 8px; } +#show-apps-btn, #show-apps-btn .overview-icon { + margin: 0; + padding: 0; +} + #dashtopanelScrollview .app-well-app:hover .overview-icon, #dashtopanelScrollview .app-well-app:focus .overview-icon { background: none; diff --git a/taskbar.js b/taskbar.js index 789c55e..fdf814c 100644 --- a/taskbar.js +++ b/taskbar.js @@ -628,12 +628,12 @@ var taskbar = new Lang.Class({ }); }, - _getTaskbarIcons: function() { + _getTaskbarIcons: function(includeAnimated) { return this._box.get_children().filter(function(actor) { return actor.child && actor.child._delegate && actor.child._delegate.icon && - !actor.animatingOut; + (includeAnimated || !actor.animatingOut); }); }, @@ -887,12 +887,8 @@ var taskbar = new Lang.Class({ // Reset the displayed apps icon to mantain the correct order resetAppIcons : function() { - - let children = this._box.get_children().filter(function(actor) { - return actor.child && - actor.child._delegate && - actor.child._delegate.icon; - }); + let children = this._getTaskbarIcons(true); + for (let i = 0; i < children.length; i++) { let item = children[i]; item.destroy(); diff --git a/windowPreview.js b/windowPreview.js index 1470f8e..de73446 100644 --- a/windowPreview.js +++ b/windowPreview.js @@ -255,7 +255,7 @@ var thumbnailPreviewMenu = new Lang.Class({ this._activeMenuItem.setActive(false); if (this._boxPointer.actor.visible) { - this._boxPointer.hide(animate, Lang.bind(this, function() { + (this._boxPointer.close || this._boxPointer.hide).call(this._boxPointer, animate, Lang.bind(this, function() { this.emit('menu-closed', this); })); }