@@ -91,6 +91,10 @@ void EditorPropertyText::_text_changed(const String &p_string) {
9191 return ;
9292 }
9393
94+ // Set tooltip so that the full text is displayed in a tooltip if hovered.
95+ // This is useful when using a narrow inspector, as the text can be trimmed otherwise.
96+ text->set_tooltip_text (get_tooltip_string (text->get_text ()));
97+
9498 if (string_name) {
9599 emit_changed (get_edited_property (), StringName (p_string));
96100 } else {
@@ -104,6 +108,7 @@ void EditorPropertyText::update_property() {
104108 if (text->get_text () != s) {
105109 int caret = text->get_caret_column ();
106110 text->set_text (s);
111+ text->set_tooltip_text (get_tooltip_string (s));
107112 text->set_caret_column (caret);
108113 }
109114 text->set_editable (!is_read_only ());
@@ -150,10 +155,14 @@ void EditorPropertyMultilineText::_set_read_only(bool p_read_only) {
150155
151156void EditorPropertyMultilineText::_big_text_changed () {
152157 text->set_text (big_text->get_text ());
158+ // Set tooltip so that the full text is displayed in a tooltip if hovered.
159+ // This is useful when using a narrow inspector, as the text can be trimmed otherwise.
160+ text->set_tooltip_text (get_tooltip_string (big_text->get_text ()));
153161 emit_changed (get_edited_property (), big_text->get_text (), " " , true );
154162}
155163
156164void EditorPropertyMultilineText::_text_changed () {
165+ text->set_tooltip_text (get_tooltip_string (text->get_text ()));
157166 emit_changed (get_edited_property (), text->get_text (), " " , true );
158167}
159168
@@ -182,6 +191,7 @@ void EditorPropertyMultilineText::update_property() {
182191 String t = get_edited_property_value ();
183192 if (text->get_text () != t) {
184193 text->set_text (t);
194+ text->set_tooltip_text (get_tooltip_string (t));
185195 if (big_text && big_text->is_visible_in_tree ()) {
186196 big_text->set_text (t);
187197 }
0 commit comments