mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-22 09:19:03 +00:00
Ladybird: Remember window position and size on close
This commit is contained in:
committed by
Sam Atkins
parent
bf927344fb
commit
b7b02693b9
@@ -114,7 +114,16 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
||||
Ladybird::s_settings = adopt_own_if_nonnull(new Ladybird::Settings());
|
||||
Ladybird::BrowserWindow window(initial_url, cookie_jar, webdriver_content_ipc_path, enable_callgrind_profiling ? WebView::EnableCallgrindProfiling::Yes : WebView::EnableCallgrindProfiling::No, use_lagom_networking ? Ladybird::UseLagomNetworking::Yes : Ladybird::UseLagomNetworking::No);
|
||||
window.setWindowTitle("Ladybird");
|
||||
window.resize(800, 600);
|
||||
|
||||
if (Ladybird::s_settings->is_maximized()) {
|
||||
window.showMaximized();
|
||||
} else {
|
||||
auto last_position = Ladybird::s_settings->last_position();
|
||||
if (last_position.has_value())
|
||||
window.move(last_position.value());
|
||||
window.resize(Ladybird::s_settings->last_size());
|
||||
}
|
||||
|
||||
window.show();
|
||||
|
||||
return event_loop.exec();
|
||||
|
||||
Reference in New Issue
Block a user