diff options
author | Linus Groh <mail@linusgroh.de> | 2020-08-15 16:32:11 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-08-15 17:38:19 +0200 |
commit | 0cab3bca2fb743f6bdc1e138b9f084cfcb42c7e4 (patch) | |
tree | a2907227d8887b61157aee98914b62eb4302110e /Games | |
parent | 5f724b6ca1aae3a5a8c7189069649e8a9347cca2 (diff) | |
download | serenity-0cab3bca2fb743f6bdc1e138b9f084cfcb42c7e4.zip |
LibGUI: Add and use Window::center_on_screen()
Various applications were using the same slightly verbose code to center
themselves on the screen/desktop:
Gfx::IntRect window_rect { 0, 0, width, height };
window_rect.center_within(GUI::Desktop::the().rect());
window->set_rect(window_rect);
Which now becomes:
window->resize(width, height);
window->center_on_screen();
Diffstat (limited to 'Games')
0 files changed, 0 insertions, 0 deletions