diff options
Diffstat (limited to 'editor')
-rw-r--r-- | editor/editor_properties.cpp | 7 | ||||
-rw-r--r-- | editor/editor_properties.h | 1 |
2 files changed, 8 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; diff --git a/editor/editor_properties.h b/editor/editor_properties.h index ea107d76b0..5726ccfa41 100644 --- a/editor/editor_properties.h +++ b/editor/editor_properties.h @@ -61,6 +61,7 @@ protected: public: virtual void update_property(); + void set_placeholder(const String &p_string); EditorPropertyText(); }; |