mirror of
https://github.com/finos/SymphonyElectron.git
synced 2026-10-25 22:20:06 -05:00
SDA-3422 - Delay resizing window (#1308)
This commit is contained in:
1 parent
9e4a51fcfc
commit
f0c2a6bfe1
1 file changed
+21
-17
+21
-17
@@ -1185,23 +1185,27 @@ export const loadBrowserViews = async (
|
||||
|
||||
// Workaround to fix the auto resize of the main view container height
|
||||
mainWindow.on('resize', () => {
|
||||
if (
|
||||
!mainView ||
|
||||
mainView.webContents.isDestroyed() ||
|
||||
!mainWindow ||
|
||||
!windowExists(mainWindow)
|
||||
) {
|
||||
return;
|
||||
}
|
||||
const bounds = mainView.getBounds();
|
||||
const [, height] = mainWindow.getSize();
|
||||
mainView.setBounds({
|
||||
...bounds,
|
||||
...{
|
||||
y: mainWindow.isFullScreen() ? 0 : TITLE_BAR_HEIGHT,
|
||||
height: mainWindow.isFullScreen() ? height : height - TITLE_BAR_HEIGHT,
|
||||
},
|
||||
});
|
||||
setTimeout(() => {
|
||||
if (
|
||||
!mainView ||
|
||||
mainView.webContents.isDestroyed() ||
|
||||
!mainWindow ||
|
||||
!windowExists(mainWindow)
|
||||
) {
|
||||
return;
|
||||
}
|
||||
const bounds = mainView.getBounds();
|
||||
const [, height] = mainWindow.getSize();
|
||||
mainView.setBounds({
|
||||
...bounds,
|
||||
...{
|
||||
y: mainWindow.isFullScreen() ? 0 : TITLE_BAR_HEIGHT,
|
||||
height: mainWindow.isFullScreen()
|
||||
? height
|
||||
: height - TITLE_BAR_HEIGHT,
|
||||
},
|
||||
});
|
||||
}, 500);
|
||||
});
|
||||
|
||||
windowHandler.setMainView(mainView);
|
||||
|
||||
Reference in new issue
Block a user