fix resizing
This commit is contained in:
parent
67ef2abb24
commit
92ec433539
@ -18,6 +18,8 @@ export function getAppView() {
|
||||
}
|
||||
|
||||
function resizeAppView() {
|
||||
// TODO: workaround: set timeout is needed as mainWindow.getBounds() needs some time to update
|
||||
setTimeout(() => {
|
||||
if (!mainWindow || !appView) {
|
||||
return;
|
||||
}
|
||||
@ -30,6 +32,7 @@ function resizeAppView() {
|
||||
width: width - sidebarWidth,
|
||||
height: height,
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
export async function createWindow() {
|
||||
@ -92,16 +95,7 @@ export async function createWindow() {
|
||||
});
|
||||
resizeAppView();
|
||||
appView.setAutoResize({ width: true, height: true });
|
||||
|
||||
// TODO: workaround to fix appView resizing when window is resized
|
||||
mainWindow.on("maximize", resizeAppView);
|
||||
mainWindow.on("unmaximize", resizeAppView);
|
||||
mainWindow.on("minimize", resizeAppView);
|
||||
mainWindow.on("restore", resizeAppView);
|
||||
mainWindow.on("resize", resizeAppView);
|
||||
mainWindow.on("show", resizeAppView);
|
||||
mainWindow.on("enter-full-screen", resizeAppView);
|
||||
mainWindow.on("leave-full-screen", resizeAppView);
|
||||
|
||||
mainWindow.once("ready-to-show", () => {
|
||||
mainWindow?.show();
|
||||
|
Loading…
Reference in New Issue
Block a user