mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 17:47:44 +00:00
Demos+LibDesktop: Centralize screensaver logic
We have 3 demos with pretty similar window logic and quitting behavior on user activity, so centralize that into `Desktop::Screensaver`.
This commit is contained in:
parent
379e4a2432
commit
18b6bdb563
11 changed files with 108 additions and 99 deletions
|
@ -27,16 +27,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
|
||||
TRY(Core::System::pledge("stdio recvfd sendfd rpath prot_exec"));
|
||||
|
||||
auto app_icon = GUI::Icon::default_icon("app-tubes"sv);
|
||||
auto window = TRY(GUI::Window::try_create());
|
||||
|
||||
window->set_double_buffering_enabled(true);
|
||||
window->set_title("Tubes");
|
||||
window->set_resizable(false);
|
||||
window->set_frameless(true);
|
||||
window->set_fullscreen(true);
|
||||
window->set_minimizable(false);
|
||||
window->set_icon(app_icon.bitmap_for_size(16));
|
||||
auto window = TRY(Desktop::Screensaver::create_window("Tubes"sv, "app-tubes"sv));
|
||||
window->update();
|
||||
|
||||
auto tubes_widget = TRY(window->try_set_main_widget<Tubes>(refresh_rate));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue