mirror of
https://github.com/tiddly-gittly/TidGi-Desktop.git
synced 2025-12-06 02:30:47 -08:00
fix: menubar window width height wrong
This commit is contained in:
parent
8480d576ef
commit
660c40539f
2 changed files with 10 additions and 4 deletions
|
|
@ -47,8 +47,14 @@ export async function handleAttachToMenuBar(windowConfig: BrowserWindowConstruct
|
|||
if (menuBar.window === undefined) {
|
||||
logger.debug('menuBar.window is undefined');
|
||||
} else {
|
||||
menuBar.window.setPosition(windowWithBrowserViewState.x, windowWithBrowserViewState.y, false);
|
||||
menuBar.window.setSize(windowWithBrowserViewState.width, windowWithBrowserViewState.height, false);
|
||||
const haveXYValue = [windowWithBrowserViewState.x, windowWithBrowserViewState.y].every((value) => Number.isFinite(value));
|
||||
const haveWHValue = [windowWithBrowserViewState.width, windowWithBrowserViewState.height].every((value) => Number.isFinite(value));
|
||||
if (haveXYValue) {
|
||||
menuBar.window.setPosition(windowWithBrowserViewState.x, windowWithBrowserViewState.y, false);
|
||||
}
|
||||
if (haveWHValue) {
|
||||
menuBar.window.setSize(windowWithBrowserViewState.width, windowWithBrowserViewState.height, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
const view = menuBar.window?.getBrowserView();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue