diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2018-08-20 17:15:03 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-20 17:15:03 +0200 |
commit | 75e540ce7259adbe1b1d4b22f2444078953da494 (patch) | |
tree | d8ed853606437b9ab7efc10d95d6d432a41585fe /editor/editor_properties.cpp | |
parent | 16f7ff1ee946cc04f03670fb66eeb24392d8384d (diff) | |
parent | 661c9ece7cf167fd654a255ed80de0023ba171d9 (diff) |
Merge pull request #21148 from akien-mga/placeholder_text_hint
Add PROPERTY_HINT_PLACEHOLDER_TEXT for String properties
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; |