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:
parent
15fad649ea
commit
069d21ed7f
15 changed files with 105 additions and 7 deletions
|
@ -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 };
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue