File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -108,6 +108,13 @@ void EditorPropertyText::update_property() {
108108
109109void EditorPropertyText::set_string_name (bool p_enabled) {
110110 string_name = p_enabled;
111+ if (p_enabled) {
112+ Label *prefix = memnew (Label (" &" ));
113+ prefix->set_tooltip_text (" StringName" );
114+ prefix->set_mouse_filter (MOUSE_FILTER_STOP );
115+ text->get_parent ()->add_child (prefix);
116+ text->get_parent ()->move_child (prefix, 0 );
117+ }
111118}
112119
113120void EditorPropertyText::set_secret (bool p_enabled) {
@@ -122,9 +129,13 @@ void EditorPropertyText::_bind_methods() {
122129}
123130
124131EditorPropertyText::EditorPropertyText () {
132+ HBoxContainer *hb = memnew (HBoxContainer);
133+ add_child (hb);
134+
125135 text = memnew (LineEdit);
126- add_child (text);
136+ hb-> add_child (text);
127137 add_focusable (text);
138+ text->set_h_size_flags (SIZE_EXPAND_FILL );
128139 text->connect (" text_changed" , callable_mp (this , &EditorPropertyText::_text_changed));
129140 text->connect (" text_submitted" , callable_mp (this , &EditorPropertyText::_text_submitted));
130141}
You can’t perform that action at this time.
0 commit comments