From adf781743074e7d3bf4dfb9db56663476c51f4c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anders=20=C3=85berg?= Date: Wed, 30 Oct 2024 13:11:27 +0100 Subject: [PATCH] adress feedback --- apps/desktop/src/main/window.main.ts | 6 ++---- apps/desktop/src/platform/popup-modal-styles.ts | 14 +++++++------- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/apps/desktop/src/main/window.main.ts b/apps/desktop/src/main/window.main.ts index f67f79ebdbe..76cc72df1c2 100644 --- a/apps/desktop/src/main/window.main.ts +++ b/apps/desktop/src/main/window.main.ts @@ -75,7 +75,6 @@ export class WindowMain { pairwise(), concatMap(async ([lastValue, newValue]) => { if (lastValue && !newValue) { - //console.log("Apply main window styles"); // Reset the window state to the main window state applyMainWindowStyles(this.win, this.windowStates[mainWindowSizeKey]); // Because modal is used in front of another app, UX wise it makes sense to hide the main window when leaving modal mode. @@ -83,7 +82,6 @@ export class WindowMain { } else if (!lastValue && newValue) { // Apply the popup modal styles applyPopupModalStyles(this.win); - //console.log("show the modal"); this.win.show(); } }), @@ -389,8 +387,8 @@ export class WindowMain { this.windowStates[configKey].displayBounds = screen.getDisplayMatching(bounds).bounds; // Maybe store these as well? - //console.log("isFocused", win.isFocused()); - //console.log("isVisible", win.isVisible()); + // win.isFocused(); + // win.isVisible(); if (!win.isMaximized() && !win.isMinimized() && !win.isFullScreen()) { this.windowStates[configKey].x = bounds.x; diff --git a/apps/desktop/src/platform/popup-modal-styles.ts b/apps/desktop/src/platform/popup-modal-styles.ts index a024ada9061..9c3f06b34bf 100644 --- a/apps/desktop/src/platform/popup-modal-styles.ts +++ b/apps/desktop/src/platform/popup-modal-styles.ts @@ -29,15 +29,15 @@ export function applyMainWindowStyles(window: BrowserWindow, existingWindowState window.setMinimumSize(680, 500); // need to guard against null/undefined values - if (existingWindowState) { - if (existingWindowState.width && existingWindowState.height) { - window.setSize(existingWindowState.width, existingWindowState.height); - } - if (existingWindowState.x && existingWindowState.y) { - window.setPosition(existingWindowState.x, existingWindowState.y); - } + if (existingWindowState?.width && existingWindowState?.height) { + window.setSize(existingWindowState.width, existingWindowState.height); } + + if (existingWindowState?.x && existingWindowState?.y) { + window.setPosition(existingWindowState.x, existingWindowState.y); + } + window.setWindowButtonVisibility?.(true); window.setMenuBarVisibility?.(true); window.setResizable(true);