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:
parent
2c9147154c
commit
9227e66bb4
1 changed files with 1 additions and 3 deletions
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue