From 6f69be969ce962dd3088cb8c893b88be6ce1dfa7 Mon Sep 17 00:00:00 2001 From: nuttylmao Date: Mon, 15 Sep 2025 01:38:10 +1000 Subject: [PATCH] Fixed window sizing issues --- .common/core/widget-dock-core/index.html | 2 +- .common/core/widget-dock-core/script.js | 2 +- .common/core/widget-dock-core/style.css | 76 ++++++++++++++++++++---- .common/styles/global.css | 4 +- printer-bot/contents/index.html | 6 +- 5 files changed, 72 insertions(+), 18 deletions(-) diff --git a/.common/core/widget-dock-core/index.html b/.common/core/widget-dock-core/index.html index 4aa341f..85038fd 100644 --- a/.common/core/widget-dock-core/index.html +++ b/.common/core/widget-dock-core/index.html @@ -38,7 +38,7 @@ - +
diff --git a/.common/core/widget-dock-core/script.js b/.common/core/widget-dock-core/script.js index e67d58f..bdbbff8 100644 --- a/.common/core/widget-dock-core/script.js +++ b/.common/core/widget-dock-core/script.js @@ -243,7 +243,7 @@ function SetRequiredActionState(isSuccess) { // PAGE INTERACTIONS // /////////////////////// -function Connect() { +function Connect() { sbClientListeners = sbClient.listeners; sbClient.options.host = sbAddressInput.value; sbClient.options.port = sbPortInput.value; diff --git a/.common/core/widget-dock-core/style.css b/.common/core/widget-dock-core/style.css index 198d01e..a9f0f03 100644 --- a/.common/core/widget-dock-core/style.css +++ b/.common/core/widget-dock-core/style.css @@ -5,6 +5,11 @@ body { flex-direction: column; } +/* Needed to force correct emoji representation */ +span { + font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif; +} + /**************/ @@ -17,7 +22,7 @@ body { align-items: center; padding: 0em 1em; gap: 1em; - box-shadow: 0 0 10px rgba(0,0,0,1); + box-shadow: 0 0 10px rgba(0, 0, 0, 1); z-index: 1; } @@ -46,10 +51,51 @@ body { /********************************/ #sb-required-actions-dialog { - max-width: 30em; + max-width: 80%; + max-height: 80%; + overflow: auto; display: none; } +#sb-connect-dialog { + max-width: 90%; + /* never wider than 90% of viewport */ + width: 90%; + /* scale with window */ + max-height: 90vh; + /* never taller than 90% of viewport */ + overflow-y: auto; + /* vertical scroll if content overflows */ + overflow-x: hidden; + /* prevent horizontal scroll */ + box-sizing: border-box; + /* include padding in width/height */ +} + +#sb-connect-dialog { + width: 90%; + max-width: 30em; + max-height: 90vh; + overflow-y: auto; + overflow-x: hidden; + box-sizing: border-box; + position: fixed; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + padding: 1em; +} + +#sb-connect-dialog>div:nth-of-type(2) { + display: flex; + gap: 1em; +} + +#sb-connect-dialog .field { + flex: 1; + min-width: 0; +} + #sb-connect-button:enabled:hover { background-color: #3be477; } @@ -72,6 +118,7 @@ body { display: flex; flex-direction: row; align-items: center; + gap: 1em; } .sb-required-action-found { @@ -79,17 +126,22 @@ body { } #sb-import-code { - white-space: nowrap; - overflow-x: auto; - overflow-y: hidden; - max-width: 100%; - padding: 0.5em; - font-family: monospace; - font-size: 1em; + white-space: nowrap; + overflow-x: auto; + overflow-y: hidden; + width: 100%; + font-family: monospace; + font-size: 1em; + padding: 0.5em; } #sb-import-wrapper { - display: flex; - align-items: center; - gap: 0.5em; + display: flex; + align-items: center; + gap: 0.5em; + max-width: 30em; +} + +#sb-import-copy-button { + width: auto; } \ No newline at end of file diff --git a/.common/styles/global.css b/.common/styles/global.css index 81b3616..7b1de30 100644 --- a/.common/styles/global.css +++ b/.common/styles/global.css @@ -23,6 +23,8 @@ body { margin: 0; padding: 0; font-family: Inter, system-ui, sans-serif; + /* font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif; */ + /* font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif; */ color: white; background-color: var(--background-color); } @@ -47,7 +49,7 @@ body { .setting-description { font-size: 0.9em; - font-weight: 200; + font-weight: 100; } .setting-attribute { diff --git a/printer-bot/contents/index.html b/printer-bot/contents/index.html index 741461d..7dc75f8 100644 --- a/printer-bot/contents/index.html +++ b/printer-bot/contents/index.html @@ -18,14 +18,14 @@
- +
Paper Width (mm)
Printer Bot was designed for 80mm thermal paper
- +
Ignore Test Triggers
In enabled, 'Test' and 'Simulate' events will be ignored
- +
Delete Temp Files
Turn this off for debugging