mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-04 07:36:50 +00:00
WindowServer+LibGUI: Handle mouse wheel deltas in the mouse event stream.
The wheel events will end up in GWidget::mousewheel_event(GMouseEvent&) on the client-side. This patch also implements basic wheel scrolling in GScrollableWidget via this mechanism. :^)
This commit is contained in:
@@ -27,6 +27,12 @@ GScrollableWidget::~GScrollableWidget()
|
||||
{
|
||||
}
|
||||
|
||||
void GScrollableWidget::mousewheel_event(GMouseEvent& event)
|
||||
{
|
||||
// FIXME: The wheel delta multiplier should probably come from... somewhere?
|
||||
vertical_scrollbar().set_value(vertical_scrollbar().value() + event.wheel_delta() * 20);
|
||||
}
|
||||
|
||||
void GScrollableWidget::resize_event(GResizeEvent& event)
|
||||
{
|
||||
auto inner_rect = frame_inner_rect_for_size(event.size());
|
||||
|
||||
Reference in New Issue
Block a user