mirror of
https://github.com/RGBCube/serenity
synced 2025-07-24 17:27:35 +00:00
LibGUI: Accept() mouse wheel events in {Spin,Combo}Boxes
Prevents ScrollableContainerWidgets from moving when changing values in embedded widgets with the mouse wheel.
This commit is contained in:
parent
5c9a140084
commit
9cf93528f5
2 changed files with 2 additions and 0 deletions
|
@ -39,6 +39,7 @@ private:
|
|||
set_focus(true);
|
||||
if (on_mousewheel)
|
||||
on_mousewheel(event.wheel_delta_y());
|
||||
event.accept();
|
||||
}
|
||||
|
||||
virtual void keydown_event(KeyEvent& event) override
|
||||
|
|
|
@ -108,6 +108,7 @@ void SpinBox::mousewheel_event(MouseEvent& event)
|
|||
if (event.modifiers() == KeyModifier::Mod_Ctrl)
|
||||
wheel_delta *= 6;
|
||||
set_value(m_value - wheel_delta);
|
||||
event.accept();
|
||||
}
|
||||
|
||||
void SpinBox::resize_event(ResizeEvent& event)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue