Skip to content

Commit

Permalink
control size and bounds test
Browse files Browse the repository at this point in the history
  • Loading branch information
Galkon committed Nov 13, 2023
1 parent 71c1e4a commit bdf9d0e
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
12 changes: 11 additions & 1 deletion main.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ const start = async () => {
closable: false,
fullscreen: false,
movable: false,
resizable: false,
alwaysOnTop: props.alwaysOnTop ?? true,
x,
y,
Expand All @@ -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
Expand Down
14 changes: 14 additions & 0 deletions src/renderer/renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
]

Expand Down

0 comments on commit bdf9d0e

Please sign in to comment.