1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-14 22:54:57 +00:00

LibGUI: Implement keyboard and mouse wheel events for SpinBox

This commit is contained in:
Tibor Nagy 2020-02-24 10:20:25 +01:00 committed by Andreas Kling
parent 17846dd063
commit 5f913c67d9
4 changed files with 34 additions and 5 deletions

View file

@ -56,6 +56,10 @@ ScrollableWidget::~ScrollableWidget()
void ScrollableWidget::mousewheel_event(MouseEvent& event)
{
if (!m_scrollbars_enabled) {
event.ignore();
return;
}
// FIXME: The wheel delta multiplier should probably come from... somewhere?
vertical_scrollbar().set_value(vertical_scrollbar().value() + event.wheel_delta() * 20);
}