mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-07 17:15:26 +00:00
WindowServer: Make tiled windows actually centered.
The right window had a few pixels on the right cut off, i don't know how i didn't notice this earlier.
This commit is contained in:
@@ -301,7 +301,7 @@ void WSWindow::set_tiled(WindowTileType tiled)
|
||||
m_tiled = tiled;
|
||||
auto old_rect = m_rect;
|
||||
|
||||
auto frame_width = m_frame.rect().width() - m_rect.width();
|
||||
int frame_width = (m_frame.rect().width() - m_rect.width()) / 2;
|
||||
switch (tiled) {
|
||||
case WindowTileType::None :
|
||||
set_rect(m_untiled_rect);
|
||||
@@ -310,14 +310,14 @@ void WSWindow::set_tiled(WindowTileType tiled)
|
||||
m_untiled_rect = m_rect;
|
||||
set_rect(0,
|
||||
WSWindowManager::the().maximized_window_rect(*this).y(),
|
||||
WSScreen::the().width() / 2,
|
||||
WSScreen::the().width() / 2 - frame_width,
|
||||
WSWindowManager::the().maximized_window_rect(*this).height());
|
||||
break;
|
||||
case WindowTileType::Right :
|
||||
m_untiled_rect = m_rect;
|
||||
set_rect(WSScreen::the().width() / 2 + frame_width,
|
||||
WSWindowManager::the().maximized_window_rect(*this).y(),
|
||||
(WSScreen::the().width() / 2),
|
||||
(WSScreen::the().width() / 2) - frame_width,
|
||||
WSWindowManager::the().maximized_window_rect(*this).height());
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user