summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--editor/editor_spin_slider.cpp14
-rw-r--r--editor/editor_spin_slider.h1
2 files changed, 13 insertions, 2 deletions
diff --git a/editor/editor_spin_slider.cpp b/editor/editor_spin_slider.cpp
index ec90af1bcc..82b5ec5ca1 100644
--- a/editor/editor_spin_slider.cpp
+++ b/editor/editor_spin_slider.cpp
@@ -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();
@@ -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;
}
}
@@ -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;
diff --git a/editor/editor_spin_slider.h b/editor/editor_spin_slider.h
index 7e10764491..68448b3240 100644
--- a/editor/editor_spin_slider.h
+++ b/editor/editor_spin_slider.h
@@ -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();