From bdf9d0e5978078254095ac228fb626ab0832b5f2 Mon Sep 17 00:00:00 2001 From: Galkon Date: Mon, 13 Nov 2023 12:34:38 -0700 Subject: [PATCH] control size and bounds test --- main.js | 12 +++++++++++- src/renderer/renderer.js | 14 ++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/main.js b/main.js index e170e24..7ba8bbc 100644 --- a/main.js +++ b/main.js @@ -124,6 +124,7 @@ const start = async () => { closable: false, fullscreen: false, movable: false, + resizable: false, alwaysOnTop: props.alwaysOnTop ?? true, x, y, @@ -134,11 +135,20 @@ const start = async () => { overlay.setIgnoreMouseEvents(true) if (props.delayShow) { - await new Promise(resolve => setTimeout(resolve, 3000)) + await new Promise(resolve => setTimeout(resolve, 2000)) + + if (props.controlSizeAndBounds) { + overlay.setContentSize(width, height) + overlay.setBounds({x, y, width, height}) + } + if (!props.alwaysOnTop) { overlay.setAlwaysOnTop(true, 'status') } overlay.showInactive() + } else if (props.controlSizeAndBounds) { + overlay.setContentSize(width, height) + overlay.setBounds({x, y, width, height}) } const overlayHtml = isDevelopment diff --git a/src/renderer/renderer.js b/src/renderer/renderer.js index 4ad058a..9f4e1b1 100644 --- a/src/renderer/renderer.js +++ b/src/renderer/renderer.js @@ -71,6 +71,20 @@ const OverlayTests = [ backgroundColor: '#00000000', delayShow: false, offsetSize: true + }, + { + name: 'Overlay Test 8', + alwaysOnTop: true, + backgroundColor: '#00000000', + delayShow: true, + controlSizeAndBounds: true + }, + { + name: 'Overlay Test 9', + alwaysOnTop: true, + backgroundColor: '#00000000', + delayShow: false, + controlSizeAndBounds: true } ]