mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-02-22 23:55:12 +00:00
Add a slight hover highlight to GButton and WSButton. :^)
This commit is contained in:
@@ -623,6 +623,10 @@ void WSWindowManager::process_mouse_event(const WSMouseEvent& event, WSWindow*&
|
||||
if (m_cursor_tracking_button)
|
||||
return m_cursor_tracking_button->on_mouse_event(event.translated(-m_cursor_tracking_button->screen_rect().location()));
|
||||
|
||||
// This is quite hackish, but it's how the WSButton hover effect is implemented.
|
||||
if (m_hovered_button && event.type() == WSMessage::MouseMove)
|
||||
m_hovered_button->on_mouse_event(event.translated(-m_hovered_button->screen_rect().location()));
|
||||
|
||||
HashTable<WSWindow*> windows_who_received_mouse_event_due_to_cursor_tracking;
|
||||
|
||||
for (auto* window = m_windows_in_order.tail(); window; window = window->prev()) {
|
||||
@@ -1099,3 +1103,8 @@ const WSCursor& WSWindowManager::active_cursor() const
|
||||
|
||||
return *m_arrow_cursor;
|
||||
}
|
||||
|
||||
void WSWindowManager::set_hovered_button(WSButton* button)
|
||||
{
|
||||
m_hovered_button = button;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user