Userland: Use Rect::centered_within() where useful

This commit is contained in:
Andreas Kling 2021-08-30 22:18:20 +02:00
commit 087bd7f767
Notes: sideshowbarker 2024-07-18 05:03:13 +09:00
9 changed files with 15 additions and 34 deletions

View file

@ -173,8 +173,7 @@ void TaskbarWindow::update_applet_area()
if (!main_widget())
return;
main_widget()->do_layout();
Gfx::IntRect new_rect { {}, m_applet_area_size };
new_rect.center_within(m_applet_area_container->screen_relative_rect());
auto new_rect = Gfx::IntRect({}, m_applet_area_size).centered_within(m_applet_area_container->screen_relative_rect());
GUI::WindowManagerServerConnection::the().async_set_applet_area_position(new_rect.location());
}