mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 16:45:03 +00:00
LibWeb: Return whether handle_mousewheel was handled
We try scrolling a Node with the handle_mousewheel event, but if it isn't scrollable, the event should be passed back up to the page host. This is the first step in that process.
This commit is contained in:
committed by
Andreas Kling
parent
17e6287333
commit
e9c1d9c89a
@@ -156,13 +156,15 @@ void BlockBox::set_scroll_offset(const Gfx::FloatPoint& offset)
|
||||
set_needs_display();
|
||||
}
|
||||
|
||||
void BlockBox::handle_mousewheel(Badge<EventHandler>, const Gfx::IntPoint&, unsigned int, unsigned int, int wheel_delta)
|
||||
bool BlockBox::handle_mousewheel(Badge<EventHandler>, const Gfx::IntPoint&, unsigned int, unsigned int, int wheel_delta)
|
||||
{
|
||||
if (!is_scrollable())
|
||||
return;
|
||||
return false;
|
||||
auto new_offset = m_scroll_offset;
|
||||
new_offset.move_by(0, wheel_delta);
|
||||
set_scroll_offset(new_offset);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user