File tree 2 files changed +15
-1
lines changed
2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -112,7 +112,7 @@ void EditorPropertyText::update_property() {
112
112
void EditorPropertyText::set_string_name (bool p_enabled) {
113
113
string_name = p_enabled;
114
114
if (p_enabled) {
115
- Label * prefix = memnew (Label (" &" ));
115
+ prefix = memnew (Label (" &" ));
116
116
prefix->set_tooltip_text (" StringName" );
117
117
prefix->set_mouse_filter (MOUSE_FILTER_STOP);
118
118
text->get_parent ()->add_child (prefix);
@@ -128,6 +128,17 @@ void EditorPropertyText::set_placeholder(const String &p_string) {
128
128
text->set_placeholder (p_string);
129
129
}
130
130
131
+ void EditorPropertyText::_notification (int p_what) {
132
+ switch (p_what) {
133
+ case NOTIFICATION_THEME_CHANGED: {
134
+ if (prefix) {
135
+ Color font_color = get_theme_color (SNAME (" disabled_font_color" ), EditorStringName (Editor));
136
+ prefix->set_modulate (font_color);
137
+ }
138
+ } break ;
139
+ }
140
+ }
141
+
131
142
void EditorPropertyText::_bind_methods () {
132
143
}
133
144
Original file line number Diff line number Diff line change @@ -59,13 +59,16 @@ class EditorPropertyText : public EditorProperty {
59
59
GDCLASS (EditorPropertyText, EditorProperty);
60
60
LineEdit *text = nullptr ;
61
61
62
+ Label *prefix = nullptr ;
63
+
62
64
bool updating = false ;
63
65
bool string_name = false ;
64
66
void _text_changed (const String &p_string);
65
67
void _text_submitted (const String &p_string);
66
68
67
69
protected:
68
70
virtual void _set_read_only (bool p_read_only) override ;
71
+ void _notification (int p_what);
69
72
static void _bind_methods ();
70
73
71
74
public:
You can’t perform that action at this time.
0 commit comments