mirror of
https://github.com/godotengine/godot.git
synced 2025-10-19 07:53:26 +00:00
Merge pull request #110894 from Giganzo/spinbox-focus-state
Fix SpinBox stepper grabbing focus state on mouse input
This commit is contained in:
commit
131d6b14a2
1 changed files with 2 additions and 2 deletions
|
@ -257,7 +257,7 @@ void SpinBox::gui_input(const Ref<InputEvent> &p_event) {
|
||||||
switch (mb->get_button_index()) {
|
switch (mb->get_button_index()) {
|
||||||
case MouseButton::LEFT: {
|
case MouseButton::LEFT: {
|
||||||
accepted = true;
|
accepted = true;
|
||||||
line_edit->grab_focus();
|
line_edit->grab_focus(true);
|
||||||
|
|
||||||
if (mouse_on_up_button || mouse_on_down_button) {
|
if (mouse_on_up_button || mouse_on_down_button) {
|
||||||
// Arrow button is being pressed. Snap the value to next step.
|
// Arrow button is being pressed. Snap the value to next step.
|
||||||
|
@ -281,7 +281,7 @@ void SpinBox::gui_input(const Ref<InputEvent> &p_event) {
|
||||||
drag.capture_pos = mb->get_position();
|
drag.capture_pos = mb->get_position();
|
||||||
} break;
|
} break;
|
||||||
case MouseButton::RIGHT: {
|
case MouseButton::RIGHT: {
|
||||||
line_edit->grab_focus();
|
line_edit->grab_focus(true);
|
||||||
if (mouse_on_up_button || mouse_on_down_button) {
|
if (mouse_on_up_button || mouse_on_down_button) {
|
||||||
set_value(mouse_on_up_button ? get_max() : get_min());
|
set_value(mouse_on_up_button ? get_max() : get_min());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue