mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 06:37:44 +00:00
About: Center the window on screen and make it non-resizable.
This commit is contained in:
parent
d643daebb2
commit
3a2f10fbbe
1 changed files with 3 additions and 1 deletions
|
@ -3,6 +3,7 @@
|
||||||
#include <LibGUI/GLabel.h>
|
#include <LibGUI/GLabel.h>
|
||||||
#include <LibGUI/GButton.h>
|
#include <LibGUI/GButton.h>
|
||||||
#include <LibGUI/GBoxLayout.h>
|
#include <LibGUI/GBoxLayout.h>
|
||||||
|
#include <LibGUI/GDesktop.h>
|
||||||
#include <sys/utsname.h>
|
#include <sys/utsname.h>
|
||||||
|
|
||||||
int main(int argc, char** argv)
|
int main(int argc, char** argv)
|
||||||
|
@ -12,7 +13,8 @@ int main(int argc, char** argv)
|
||||||
auto* window = new GWindow;
|
auto* window = new GWindow;
|
||||||
window->set_title("About Serenity");
|
window->set_title("About Serenity");
|
||||||
Rect window_rect { 0, 0, 240, 150 };
|
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_rect(window_rect);
|
||||||
window->set_should_exit_event_loop_on_close(true);
|
window->set_should_exit_event_loop_on_close(true);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue