From f8668dfcdef7c0fe1d1e7f42cc9473db6e8db7f5 Mon Sep 17 00:00:00 2001 From: Charles Gagnon Date: Sun, 2 Aug 2020 10:58:06 -0400 Subject: [PATCH] Check preview icon size setting only if header is present --- windowPreview.js | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/windowPreview.js b/windowPreview.js index 44baf63..b5722c3 100644 --- a/windowPreview.js +++ b/windowPreview.js @@ -822,12 +822,7 @@ var Preview = Utils.defineClass({ this._removeWindowSignals(); this.window = window; this._needsCloseButton = window.can_close() && !Utils.checkIfWindowHasTransient(window); - - if (Me.settings.get_boolean('window-preview-use-custom-icon-size')){ - this._updateHeader(Me.settings.get_int('window-preview-custom-icon-size')); - } else { - this._updateHeader(headerHeight / scaleFactor * .6); - } + this._updateHeader(); }, animateOut: function() { @@ -951,8 +946,11 @@ var Preview = Utils.defineClass({ } }, - _updateHeader: function(iconTextureSize) { + _updateHeader: function() { if (headerHeight) { + let iconTextureSize = Me.settings.get_boolean('window-preview-use-custom-icon-size') ? + Me.settings.get_int('window-preview-custom-icon-size') : + headerHeight / scaleFactor * .6; let icon = this._previewMenu.getCurrentAppIcon().app.create_icon_texture(iconTextureSize); let workspaceIndex = ''; let workspaceStyle = null;