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

LibGUI: Implement enter/leave events (with WindowServer support.)

Windows now learn when the mouse cursor leaves or enters them.
Use this to implement GWidget::{enter,leave}_event() and use that
to implement the CoolBar button effect. :^)
This commit is contained in:
Andreas Kling 2019-02-20 10:12:19 +01:00
parent af7eb5c89c
commit bf30502560
14 changed files with 103 additions and 5 deletions

View file

@ -64,6 +64,10 @@ public:
bool should_exit_app_on_close() const { return m_should_exit_app_on_close; }
void set_should_exit_app_on_close(bool b) { m_should_exit_app_on_close = b; }
GWidget* hovered_widget() { return m_hovered_widget.ptr(); }
const GWidget* hovered_widget() const { return m_hovered_widget.ptr(); }
void set_hovered_widget(GWidget*);
private:
virtual const char* class_name() const override { return "GWindow"; }
@ -73,6 +77,7 @@ private:
GWidget* m_main_widget { nullptr };
GWidget* m_focused_widget { nullptr };
WeakPtr<GWidget> m_global_cursor_tracking_widget;
WeakPtr<GWidget> m_hovered_widget;
Rect m_rect_when_windowless;
String m_title_when_windowless;
Vector<Rect> m_pending_paint_event_rects;