From cc658a1b3d91736b3c6013c3c7435652e1e5be91 Mon Sep 17 00:00:00 2001 From: DC23 Date: Tue, 17 Dec 2024 21:16:25 +1100 Subject: [PATCH 1/2] Fixing bug in floating panel width initialisation. --- src/uipanel.mjs | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/uipanel.mjs b/src/uipanel.mjs index 709bb46..d6a318d 100644 --- a/src/uipanel.mjs +++ b/src/uipanel.mjs @@ -18,9 +18,9 @@ export class UIPanel extends HandlebarsApplicationMixin(ApplicationV2) { frame: false, title: 'JDTIMEKEEPING.title', icon: 'fa-solid fa-clock', - resizable: false, - width: 'auto', + resizable: true, // only applies on the undocked UI height: 'auto', + width: 'auto', }, actions: { 'time-delta': UIPanel.timeDeltaButtonHandler, @@ -49,11 +49,17 @@ export class UIPanel extends HandlebarsApplicationMixin(ApplicationV2) { static create () { const position = game.settings.get(MODULE_ID, SETTINGS.FLOATING_UI_PANEL_POSITION) - // if position if out of bounds for current client view, reset to a safe location in the top left if (position) { - position.width = 'auto' - position.height = 'auto' + // for the floating panel, reset the auto width so it can resize manually + if (UIPanel.floatingPanel) { + if (position.width === 'auto') position.width = '220' + } else { + // when docked, restore auto width + position.width = 'auto' + } + // if position if out of bounds for current client view, + // reset to a safe location in the top left if ( position.top > window.visualViewport.height || position.left > window.visualViewport.width From ef5f07d8c984a81d137987cb8926caa523574fbf Mon Sep 17 00:00:00 2001 From: DC23 Date: Tue, 17 Dec 2024 21:16:53 +1100 Subject: [PATCH 2/2] Halving Floating panel window content padding #307 --- styles/easy-timekeeping.css | 1 + 1 file changed, 1 insertion(+) diff --git a/styles/easy-timekeeping.css b/styles/easy-timekeeping.css index ddc42f6..408ce8e 100644 --- a/styles/easy-timekeeping.css +++ b/styles/easy-timekeeping.css @@ -167,6 +167,7 @@ [id^=jd-et-uipanel] .window-content { background: var(--background-color); + padding: 0.5rem; /* It inherits 1rem, but it's too much. */ } /*End*/