mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-04-25 10:08:29 +02:00
Remember size of settings window
This commit is contained in:
@@ -2021,15 +2021,6 @@ fn create_main_window(handle: &AppHandle, url: &str) -> WebviewWindow {
|
|||||||
|
|
||||||
let window = create_window(handle, config);
|
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
|
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
|
win
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user