mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 05:07:35 +00:00
LibGfx+WindowServer: Remove set_size_around() from Rect and Window
Superceded by to_floating_cursor_position() as a more accurate way to reposition windows on untile. Effectively made set_size_around() dead code, so the remnants can be removed.
This commit is contained in:
parent
a1dceb5b97
commit
68570e897d
4 changed files with 7 additions and 32 deletions
|
@ -415,7 +415,7 @@ void Window::set_occluded(bool occluded)
|
|||
WindowManager::the().notify_occlusion_state_changed(*this);
|
||||
}
|
||||
|
||||
void Window::set_maximized(bool maximized, Optional<Gfx::IntPoint> fixed_point)
|
||||
void Window::set_maximized(bool maximized)
|
||||
{
|
||||
if (is_maximized() == maximized)
|
||||
return;
|
||||
|
@ -427,13 +427,7 @@ void Window::set_maximized(bool maximized, Optional<Gfx::IntPoint> fixed_point)
|
|||
m_unmaximized_rect = m_floating_rect;
|
||||
set_rect(WindowManager::the().tiled_window_rect(*this));
|
||||
} else {
|
||||
if (fixed_point.has_value()) {
|
||||
auto new_rect = Gfx::IntRect(m_rect);
|
||||
new_rect.set_size_around(m_unmaximized_rect.size(), fixed_point.value());
|
||||
set_rect(new_rect);
|
||||
} else {
|
||||
set_rect(m_unmaximized_rect);
|
||||
}
|
||||
set_rect(m_unmaximized_rect);
|
||||
}
|
||||
m_frame.did_set_maximized({}, maximized);
|
||||
Core::EventLoop::current().post_event(*this, make<ResizeEvent>(m_rect));
|
||||
|
@ -920,21 +914,14 @@ void Window::check_untile_due_to_resize(Gfx::IntRect const& new_rect)
|
|||
m_tile_type = new_tile_type;
|
||||
}
|
||||
|
||||
bool Window::set_untiled(Optional<Gfx::IntPoint> fixed_point)
|
||||
bool Window::set_untiled()
|
||||
{
|
||||
if (m_tile_type == WindowTileType::None)
|
||||
return false;
|
||||
VERIFY(!resize_aspect_ratio().has_value());
|
||||
|
||||
m_tile_type = WindowTileType::None;
|
||||
|
||||
if (fixed_point.has_value()) {
|
||||
auto new_rect = Gfx::IntRect(m_rect);
|
||||
new_rect.set_size_around(m_floating_rect.size(), fixed_point.value());
|
||||
set_rect(new_rect);
|
||||
} else {
|
||||
set_rect(m_floating_rect);
|
||||
}
|
||||
set_rect(m_floating_rect);
|
||||
|
||||
Core::EventLoop::current().post_event(*this, make<ResizeEvent>(m_rect));
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue