summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-05-10 22:11:18 +0200
committerAndreas Kling <awesomekling@gmail.com>2019-05-10 22:11:18 +0200
commit3a2f10fbbe6d5dbe7b57e27bfb960a1e0982ef2e (patch)
treef0440b8db3482bb032ecc10caac9c7ca76cc6d7d
parentd643daebb20e743f07ba7ac004fa231826f0c3f7 (diff)
downloadserenity-3a2f10fbbe6d5dbe7b57e27bfb960a1e0982ef2e.zip
About: Center the window on screen and make it non-resizable.
-rw-r--r--Applications/About/main.cpp4
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);