From 19f6d841d0c58a33e757618830b2a7c5b00d9c69 Mon Sep 17 00:00:00 2001 From: Saif Addin Date: Sat, 29 May 2021 13:17:57 +0200 Subject: [PATCH] Fix window sizeo n overflow --- CHANGELOG.md | 3 +++ module.json | 4 ++-- modules/feature/minimize.js | 9 ++++++--- package.json | 2 +- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 26cbe34..7ac7d6b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +### 0.9.9 +* Bugfix: Fixed windows restoring to a wrong size when exceeding taskbar width + ### 0.9.8 * Special: Release to put back on track 0.7.9 People (sorry for inconvenience) diff --git a/module.json b/module.json index 2c63e08..3507423 100644 --- a/module.json +++ b/module.json @@ -3,7 +3,7 @@ "title": "Minimal UI", "author": "JeansenVaars#2857", "description": "Minimal UI allows customizing Foundry interface, by hiding, collapsing or resizing specific parts.", - "version": "0.9.8", + "version": "0.9.9", "minimumCoreVersion": "0.7.9", "compatibleCoreVersion": "0.7.9", "dependencies": [ @@ -26,5 +26,5 @@ ], "url": "https://github.com/saif-ellafi/foundryvtt-minimal-ui.git", "manifest": "https://github.com/saif-ellafi/foundryvtt-minimal-ui/releases/latest/download/module.json", - "download": "https://github.com/saif-ellafi/foundryvtt-minimal-ui/releases/latest/download/foundryvtt-minimal-ui_0.9.8.zip" + "download": "https://github.com/saif-ellafi/foundryvtt-minimal-ui/releases/latest/download/foundryvtt-minimal-ui_0.9.9.zip" } diff --git a/modules/feature/minimize.js b/modules/feature/minimize.js index 38c2431..0659577 100644 --- a/modules/feature/minimize.js +++ b/modules/feature/minimize.js @@ -69,14 +69,17 @@ export default class MinimalUIMinimize { if (MinimalUIMinimize.minimizedStash[i]?.app.appId === app.appId) { MinimalUIMinimize.minimizedStash[i].oldPosition = Object.assign({}, app.position); targetPos = i; - break; + return targetPos; } else if (!targetPos && !MinimalUIMinimize.minimizedStash[i]?.app.rendered) { MinimalUIMinimize.minimizedStash[i] = {app: app, oldPosition: Object.assign({}, app.position)}; targetPos = i; - break; + return targetPos; } } - return targetPos; + let appI = app.position.left; + while (appI in MinimalUIMinimize.minimizedStash) appI += 20; + MinimalUIMinimize.minimizedStash[appI] = {app: app, oldPosition: Object.assign({}, app.position)}; + return appI; } static setMinimizedPosition(app) { diff --git a/package.json b/package.json index ff1a95d..99f31f0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "foundryvtt-minimal-ui", - "version": "0.9.8", + "version": "0.9.9", "description": "Minimal UI allows customizing Foundry interface, by hiding, collapsing or resizing specific parts.", "main": "minimalui.js", "scripts": {