1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-28 01:25:09 +00:00

LibGUI: WidgetScrollable scrolls horizontally when shift is pressed

This commit is contained in:
Mathieu PATUREL 2020-08-03 11:25:23 +10:00 committed by Andreas Kling
parent 8b0b653471
commit 7d12e0c7f1

View file

@ -61,7 +61,11 @@ void ScrollableWidget::mousewheel_event(MouseEvent& event)
return;
}
// FIXME: The wheel delta multiplier should probably come from... somewhere?
vertical_scrollbar().set_value(vertical_scrollbar().value() + event.wheel_delta() * 20);
if (event.modifiers() & Mod_Shift) {
horizontal_scrollbar().set_value(horizontal_scrollbar().value() + event.wheel_delta() * 60);
} else {
vertical_scrollbar().set_value(vertical_scrollbar().value() + event.wheel_delta() * 20);
}
}
void ScrollableWidget::custom_layout()