diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2018-08-17 03:50:12 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2018-08-20 13:48:05 +0200 |
commit | 661c9ece7cf167fd654a255ed80de0023ba171d9 (patch) | |
tree | 41504fefbce620c58149185332764520e14cbfa6 /editor/editor_properties.cpp | |
parent | 1eb1606f34f0696eb5f1694a3fc563125ad914b8 (diff) |
Add PROPERTY_HINT_PLACEHOLDER_TEXT for String properties
Use it to provide a better example for application identifiers
on Android, iOS and macOS, where users thought they *had* to use
this as a magic token.
Diffstat (limited to 'editor/editor_properties.cpp')
-rw-r--r-- | editor/editor_properties.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/editor/editor_properties.cpp b/editor/editor_properties.cpp index 1c1d72e7d1..5f1e7273e5 100644 --- a/editor/editor_properties.cpp +++ b/editor/editor_properties.cpp @@ -72,6 +72,10 @@ void EditorPropertyText::update_property() { updating = false; } +void EditorPropertyText::set_placeholder(const String &p_string) { + text->set_placeholder(p_string); +} + void EditorPropertyText::_bind_methods() { ClassDB::bind_method(D_METHOD("_text_changed", "txt"), &EditorPropertyText::_text_changed); @@ -2783,6 +2787,9 @@ bool EditorInspectorDefaultPlugin::parse_property(Object *p_object, Variant::Typ } else { EditorPropertyText *editor = memnew(EditorPropertyText); + if (p_hint == PROPERTY_HINT_PLACEHOLDER_TEXT) { + editor->set_placeholder(p_hint_text); + } add_property_editor(p_path, editor); } } break; |