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
commit bf30502560
Notes: sideshowbarker 2024-07-19 15:39:57 +09:00
14 changed files with 103 additions and 5 deletions

View file

@ -63,6 +63,10 @@ void GWidget::event(GEvent& event)
return mousedown_event(static_cast<GMouseEvent&>(event));
case GEvent::MouseUp:
return mouseup_event(static_cast<GMouseEvent&>(event));
case GEvent::Enter:
return enter_event(event);
case GEvent::Leave:
return leave_event(event);
default:
return GObject::event(event);
}
@ -173,6 +177,14 @@ void GWidget::focusout_event(GEvent&)
{
}
void GWidget::enter_event(GEvent&)
{
}
void GWidget::leave_event(GEvent&)
{
}
void GWidget::update()
{
update(rect());