1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 14:27:35 +00:00

WindowServer: Add a maximize/unmaximize button to windows.

This commit is contained in:
Andreas Kling 2019-05-12 21:32:02 +02:00
parent dddf45f563
commit 641893104a
8 changed files with 95 additions and 7 deletions

View file

@ -134,6 +134,21 @@ void WSWindow::set_minimized(bool minimized)
WSWindowManager::the().notify_minimization_state_changed(*this);
}
void WSWindow::set_maximized(bool maximized)
{
if (m_maximized == maximized)
return;
m_maximized = maximized;
auto old_rect = m_rect;
if (maximized) {
m_unmaximized_rect = m_rect;
set_rect(WSWindowManager::the().maximized_window_rect(*this));
} else {
set_rect(m_unmaximized_rect);
}
WSEventLoop::the().post_event(*this, make<WSResizeEvent>(old_rect, m_rect));
}
void WSWindow::event(CEvent& event)
{
if (m_internal_owner)