Remember size of settings window

This commit is contained in:
Gregory Schier
2025-01-18 21:14:20 -08:00
parent 590ef7839c
commit 9415a3a8d7

View File

@@ -2021,15 +2021,6 @@ fn create_main_window(handle: &AppHandle, url: &str) -> WebviewWindow {
let window = create_window(handle, config);
// Restore window state if it's a main window
if !label.starts_with(OTHER_WINDOW_PREFIX) {
if let Err(e) = window.restore_state(StateFlags::all()) {
warn!("Failed to restore window state {e:?}");
} else {
debug!("Restored window state");
}
}
window
}
@@ -2124,6 +2115,16 @@ fn create_window(handle: &AppHandle, config: CreateWindowConfig) -> WebviewWindo
}
});
// Restore window state if it's a main window
let flags = if config.label.starts_with(OTHER_WINDOW_PREFIX) {
StateFlags::SIZE // Windows like settings just restore size
} else {
StateFlags::all() // Main workspace windows restore everything
};
if let Err(e) = win.restore_state(flags) {
warn!("Failed to restore window state {e:?}");
}
win
}