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:
parent
2c9147154c
commit
9227e66bb4
Notes:
sideshowbarker
2024-07-19 00:23:03 +09:00
Author: https://github.com/awesomekling
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