diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-05-10 22:11:18 +0200 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-05-10 22:11:18 +0200 |
commit | 3a2f10fbbe6d5dbe7b57e27bfb960a1e0982ef2e (patch) | |
tree | f0440b8db3482bb032ecc10caac9c7ca76cc6d7d | |
parent | d643daebb20e743f07ba7ac004fa231826f0c3f7 (diff) | |
download | serenity-3a2f10fbbe6d5dbe7b57e27bfb960a1e0982ef2e.zip |
About: Center the window on screen and make it non-resizable.
-rw-r--r-- | Applications/About/main.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Applications/About/main.cpp b/Applications/About/main.cpp index eb360e2d83..5bafc60c0e 100644 --- a/Applications/About/main.cpp +++ b/Applications/About/main.cpp @@ -3,6 +3,7 @@ #include <LibGUI/GLabel.h> #include <LibGUI/GButton.h> #include <LibGUI/GBoxLayout.h> +#include <LibGUI/GDesktop.h> #include <sys/utsname.h> int main(int argc, char** argv) @@ -12,7 +13,8 @@ int main(int argc, char** argv) auto* window = new GWindow; window->set_title("About Serenity"); Rect window_rect { 0, 0, 240, 150 }; - window_rect.center_within({ 0, 0, 1024, 768 }); + window_rect.center_within(GDesktop::the().rect()); + window->set_resizable(false); window->set_rect(window_rect); window->set_should_exit_event_loop_on_close(true); |