From be443e41bbad63155b4e3b1666afc34aa8152370 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pa=CC=84vels=20Nadtoc=CC=8Cajevs?= <7645683+bruvzg@users.noreply.github.com> Date: Mon, 1 Sep 2025 16:46:00 +0300 Subject: [PATCH] Use placeholder instead of value for tooltips of `PROPERTY_HINT_PASSWORD` properties. --- editor/inspector/editor_properties.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/editor/inspector/editor_properties.cpp b/editor/inspector/editor_properties.cpp index b27faecd4c..ebf3e28944 100644 --- a/editor/inspector/editor_properties.cpp +++ b/editor/inspector/editor_properties.cpp @@ -177,7 +177,11 @@ void EditorPropertyText::_text_changed(const String &p_string) { // Set tooltip so that the full text is displayed in a tooltip if hovered. // This is useful when using a narrow inspector, as the text can be trimmed otherwise. - text->set_tooltip_text(get_tooltip_string(text->get_text())); + if (text->is_secret()) { + text->set_tooltip_text(get_tooltip_string(text->get_placeholder())); + } else { + text->set_tooltip_text(get_tooltip_string(text->get_text())); + } if (string_name) { emit_changed(get_edited_property(), StringName(p_string)); @@ -192,7 +196,11 @@ void EditorPropertyText::update_property() { if (text->get_text() != s) { int caret = text->get_caret_column(); text->set_text(s); - text->set_tooltip_text(get_tooltip_string(s)); + if (text->is_secret()) { + text->set_tooltip_text(get_tooltip_string(text->get_placeholder())); + } else { + text->set_tooltip_text(get_tooltip_string(s)); + } text->set_caret_column(caret); } text->set_editable(!is_read_only());