1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 18:38:10 +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

@ -5,7 +5,7 @@
#include <SharedGraphics/StylePainter.h>
#include <SharedGraphics/CharacterBitmap.h>
WSButton::WSButton(WSWindowFrame& frame, Retained<CharacterBitmap>&& bitmap, Function<void()>&& on_click_handler)
WSButton::WSButton(WSWindowFrame& frame, Retained<CharacterBitmap>&& bitmap, Function<void(WSButton&)>&& on_click_handler)
: on_click(move(on_click_handler))
, m_frame(frame)
, m_bitmap(move(bitmap))
@ -47,7 +47,7 @@ void WSButton::on_mouse_event(const WSMouseEvent& event)
m_pressed = false;
if (rect().contains(event.position())) {
if (on_click)
on_click();
on_click(*this);
}
if (old_pressed != m_pressed)
wm.invalidate(screen_rect());