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

Make buttons unpress when the cursor leaves the button rect.

Implement this functionality by adding global cursor tracking.
It's currently only possible for one GWidget per GWindow to track the cursor.
This commit is contained in:
Andreas Kling 2019-01-27 08:48:34 +01:00
parent 15fad649ea
commit 069d21ed7f
15 changed files with 105 additions and 7 deletions

View file

@ -18,10 +18,12 @@ private:
virtual void paint_event(GPaintEvent&) override;
virtual void mousedown_event(GMouseEvent&) override;
virtual void mouseup_event(GMouseEvent&) override;
virtual void mousemove_event(GMouseEvent&) override;
virtual const char* class_name() const override { return "GButton"; }
String m_caption;
bool m_being_pressed { false };
bool m_tracking_cursor { false };
};