mirror of
https://github.com/RGBCube/serenity
synced 2025-05-22 19:35:06 +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:
parent
af7eb5c89c
commit
bf30502560
14 changed files with 103 additions and 5 deletions
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue