1
0
Fork 0
mirror of https://github.com/LadybirdBrowser/ladybird.git synced 2025-06-10 18:10:56 +09: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
Notes: sideshowbarker 2024-07-19 00:23:03 +09:00

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();
}