mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-26 19:29:16 +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:
@@ -89,3 +89,14 @@ void GButton::mouseup_event(GMouseEvent& event)
|
||||
GWidget::mouseup_event(event);
|
||||
}
|
||||
|
||||
void GButton::enter_event(GEvent&)
|
||||
{
|
||||
m_hovered = true;
|
||||
update();
|
||||
}
|
||||
|
||||
void GButton::leave_event(GEvent&)
|
||||
{
|
||||
m_hovered = false;
|
||||
update();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user