From 9cf93528f5680fa2f6e7eefd89f117b5bfed638d Mon Sep 17 00:00:00 2001 From: thankyouverycool <66646555+thankyouverycool@users.noreply.github.com> Date: Sun, 25 Sep 2022 13:10:28 -0400 Subject: [PATCH] LibGUI: Accept() mouse wheel events in {Spin,Combo}Boxes Prevents ScrollableContainerWidgets from moving when changing values in embedded widgets with the mouse wheel. --- Userland/Libraries/LibGUI/ComboBox.cpp | 1 + Userland/Libraries/LibGUI/SpinBox.cpp | 1 + 2 files changed, 2 insertions(+) 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)