Skip to content

Commit

Permalink
Merge pull request #54288 from Razoric480/fix-key-up-down-idle-frame
Browse files Browse the repository at this point in the history
  • Loading branch information
akien-mga authored Oct 31, 2021
2 parents 1dd7427 + 3f3cd15 commit 0b667e6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
14 changes: 12 additions & 2 deletions editor/editor_spin_slider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,8 @@ void EditorSpinSlider::_value_input_gui_input(const Ref<InputEvent> &p_event) {
set_value(last_value + real_step);
}

value_input->set_text(get_text_value());
value_input_dirty = true;
set_process_internal(true);
} break;
case KEY_DOWN: {
_evaluate_input_text();
Expand All @@ -238,7 +239,8 @@ void EditorSpinSlider::_value_input_gui_input(const Ref<InputEvent> &p_event) {
set_value(last_value - real_step);
}

value_input->set_text(get_text_value());
value_input_dirty = true;
set_process_internal(true);
} break;
}
}
Expand Down Expand Up @@ -424,6 +426,14 @@ void EditorSpinSlider::_notification(int p_what) {
_update_value_input_stylebox();
break;

case NOTIFICATION_INTERNAL_PROCESS:
if (value_input_dirty) {
value_input_dirty = false;
value_input->set_text(get_text_value());
}
set_process_internal(false);
break;

case NOTIFICATION_DRAW:
_draw_spin_slider();
break;
Expand Down
1 change: 1 addition & 0 deletions editor/editor_spin_slider.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ class EditorSpinSlider : public Range {
Popup *value_input_popup = nullptr;
LineEdit *value_input = nullptr;
bool value_input_just_closed = false;
bool value_input_dirty = false;

void _grabber_gui_input(const Ref<InputEvent> &p_event);
void _value_input_closed();
Expand Down

0 comments on commit 0b667e6

Please sign in to comment.