1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 04:38:11 +00:00

LibGUI: Use Window::center_within() in GUI::Dialog

This commit is contained in:
Andreas Kling 2020-12-30 13:44:58 +01:00
parent 2c9147154c
commit 9227e66bb4

View file

@ -48,9 +48,7 @@ int Dialog::exec()
if (parent() && parent()->is_window()) {
auto& parent_window = *static_cast<Window*>(parent());
if (parent_window.is_visible()) {
auto new_rect = rect();
new_rect.center_within(parent_window.rect());
set_rect(new_rect);
center_within(parent_window);
} else {
center_on_screen();
}