summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-12-30 13:44:58 +0100
committerAndreas Kling <kling@serenityos.org>2020-12-30 13:44:58 +0100
commit9227e66bb45afe530dd7115416d247835be5d3df (patch)
tree853fe8fd5c0db8f488b57976efabb77de103affa
parent2c9147154c2e3ec0e6030bd06237674e89ef9f10 (diff)
downloadserenity-9227e66bb45afe530dd7115416d247835be5d3df.zip
LibGUI: Use Window::center_within() in GUI::Dialog
-rw-r--r--Libraries/LibGUI/Dialog.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/Libraries/LibGUI/Dialog.cpp b/Libraries/LibGUI/Dialog.cpp
index 56e0067c87..66c5bd59e8 100644
--- a/Libraries/LibGUI/Dialog.cpp
+++ b/Libraries/LibGUI/Dialog.cpp
@@ -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();
}