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

LibGUI: Start working on a GScrollBar.

This widget is far from finished, but it's off to a good start.
Also added a GResizeEvent and GWidget::resize_event() so that widgets
can react to being resized.
This commit is contained in:
Andreas Kling 2019-02-09 11:19:38 +01:00
parent 4d5fe39494
commit 1f355f2a79
11 changed files with 231 additions and 5 deletions

View file

@ -13,6 +13,7 @@ public:
Show,
Hide,
Paint,
Resize,
MouseMove,
MouseDown,
MouseUp,
@ -62,6 +63,22 @@ private:
Rect m_rect;
};
class GResizeEvent final : public GEvent {
public:
explicit GResizeEvent(const Size& old_size, const Size& size)
: GEvent(GEvent::Resize)
, m_old_size(old_size)
, m_size(size)
{
}
const Size& old_size() const { return m_old_size; }
const Size& size() const { return m_size; }
private:
Size m_old_size;
Size m_size;
};
class GShowEvent final : public GEvent {
public:
GShowEvent()