Skip to content

Commit 9cb6411

Browse files
committed
Merge pull request #110164 from bruvzg/prop_pass
Use placeholder instead of value for tooltips of `PROPERTY_HINT_PASSWORD` properties.
2 parents 191efe2 + be443e4 commit 9cb6411

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

editor/inspector/editor_properties.cpp

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,11 @@ void EditorPropertyText::_text_changed(const String &p_string) {
177177

178178
// Set tooltip so that the full text is displayed in a tooltip if hovered.
179179
// This is useful when using a narrow inspector, as the text can be trimmed otherwise.
180-
text->set_tooltip_text(get_tooltip_string(text->get_text()));
180+
if (text->is_secret()) {
181+
text->set_tooltip_text(get_tooltip_string(text->get_placeholder()));
182+
} else {
183+
text->set_tooltip_text(get_tooltip_string(text->get_text()));
184+
}
181185

182186
if (string_name) {
183187
emit_changed(get_edited_property(), StringName(p_string));
@@ -192,7 +196,11 @@ void EditorPropertyText::update_property() {
192196
if (text->get_text() != s) {
193197
int caret = text->get_caret_column();
194198
text->set_text(s);
195-
text->set_tooltip_text(get_tooltip_string(s));
199+
if (text->is_secret()) {
200+
text->set_tooltip_text(get_tooltip_string(text->get_placeholder()));
201+
} else {
202+
text->set_tooltip_text(get_tooltip_string(s));
203+
}
196204
text->set_caret_column(caret);
197205
}
198206
text->set_editable(!is_read_only());

0 commit comments

Comments
 (0)