You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-04 12:00:25 +00:00
Merge pull request #85652 from rsubtil/bugfix-can_grab_focus
Ensure slider grabs focus only when it can
This commit is contained in:
@@ -88,10 +88,14 @@ void Slider::gui_input(const Ref<InputEvent> &p_event) {
|
||||
}
|
||||
} else if (scrollable) {
|
||||
if (mb->is_pressed() && mb->get_button_index() == MouseButton::WHEEL_UP) {
|
||||
grab_focus();
|
||||
if (get_focus_mode() != FOCUS_NONE) {
|
||||
grab_focus();
|
||||
}
|
||||
set_value(get_value() + get_step());
|
||||
} else if (mb->is_pressed() && mb->get_button_index() == MouseButton::WHEEL_DOWN) {
|
||||
grab_focus();
|
||||
if (get_focus_mode() != FOCUS_NONE) {
|
||||
grab_focus();
|
||||
}
|
||||
set_value(get_value() - get_step());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user