summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2021-02-25 18:09:04 +0100
committerGitHub <noreply@github.com>2021-02-25 18:09:04 +0100
commit494e1cb1487c90425e3f5ae2cdf9e4046c3f550c (patch)
tree8eecd8a6a434c92ce31806c33a67de641b2b91bb
parent9e24ad5a3f7ede1a4718c948cf17741de7950a93 (diff)
parent707cf278a517aac9718b6322a32208085c322999 (diff)
Merge pull request #38918 from EricEzaM/fix-slider-focus-on-scroll-input
Fixed issue with slider focus and scroll input
-rw-r--r--scene/gui/slider.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/scene/gui/slider.cpp b/scene/gui/slider.cpp
index 8b07299e30..2239226c78 100644
--- a/scene/gui/slider.cpp
+++ b/scene/gui/slider.cpp
@@ -73,8 +73,10 @@ void Slider::_gui_input(Ref<InputEvent> p_event) {
}
} else if (scrollable) {
if (mb->is_pressed() && mb->get_button_index() == BUTTON_WHEEL_UP) {
+ grab_focus();
set_value(get_value() + get_step());
} else if (mb->is_pressed() && mb->get_button_index() == BUTTON_WHEEL_DOWN) {
+ grab_focus();
set_value(get_value() - get_step());
}
}