Explorar o código

Don't emit text_changed signal when clearing empty LineEdit

kobewi hai 9 meses
pai
achega
b8b1584f5a
Modificáronse 1 ficheiros con 5 adicións e 1 borrados
  1. 5 1
      scene/gui/line_edit.cpp

+ 5 - 1
scene/gui/line_edit.cpp

@@ -1853,8 +1853,12 @@ Array LineEdit::get_structured_text_bidi_override_options() const {
 }
 
 void LineEdit::clear() {
+	bool was_empty = text.is_empty();
 	clear_internal();
-	_text_changed();
+	_clear_redo();
+	if (!was_empty) {
+		_emit_text_change();
+	}
 
 	// This should reset virtual keyboard state if needed.
 	if (editing) {