diff options
author | thankyouverycool <66646555+thankyouverycool@users.noreply.github.com> | 2022-09-25 13:10:28 -0400 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-11-19 11:04:11 +0100 |
commit | 9cf93528f5680fa2f6e7eefd89f117b5bfed638d (patch) | |
tree | eb8cb72fc013e20058f1bde89e19829d541cefa9 /Userland | |
parent | 5c9a1400847352e9d13877f555356273ca7029f9 (diff) | |
download | serenity-9cf93528f5680fa2f6e7eefd89f117b5bfed638d.zip |
LibGUI: Accept() mouse wheel events in {Spin,Combo}Boxes
Prevents ScrollableContainerWidgets from moving when changing
values in embedded widgets with the mouse wheel.
Diffstat (limited to 'Userland')
-rw-r--r-- | Userland/Libraries/LibGUI/ComboBox.cpp | 1 | ||||
-rw-r--r-- | Userland/Libraries/LibGUI/SpinBox.cpp | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/Userland/Libraries/LibGUI/ComboBox.cpp b/Userland/Libraries/LibGUI/ComboBox.cpp index 7895b108ff..58615c6948 100644 --- a/Userland/Libraries/LibGUI/ComboBox.cpp +++ b/Userland/Libraries/LibGUI/ComboBox.cpp @@ -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 diff --git a/Userland/Libraries/LibGUI/SpinBox.cpp b/Userland/Libraries/LibGUI/SpinBox.cpp index a2acc9ffc1..3ce4d3695f 100644 --- a/Userland/Libraries/LibGUI/SpinBox.cpp +++ b/Userland/Libraries/LibGUI/SpinBox.cpp @@ -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) |