summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--scene/gui/text_edit.cpp4
-rw-r--r--scene/gui/text_edit.h4
-rw-r--r--scene/resources/syntax_highlighter.cpp2
3 files changed, 7 insertions, 3 deletions
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp
index 4a013be1dc..9e159cd303 100644
--- a/scene/gui/text_edit.cpp
+++ b/scene/gui/text_edit.cpp
@@ -6018,6 +6018,10 @@ bool TextEdit::is_drawing_spaces() const {
return draw_spaces;
}
+Color TextEdit::get_font_color() const {
+ return theme_cache.font_color;
+}
+
void TextEdit::_bind_methods() {
/* Internal. */
diff --git a/scene/gui/text_edit.h b/scene/gui/text_edit.h
index 7be58bd927..56d5b67e0b 100644
--- a/scene/gui/text_edit.h
+++ b/scene/gui/text_edit.h
@@ -41,8 +41,6 @@
class TextEdit : public Control {
GDCLASS(TextEdit, Control);
- friend class CodeHighlighter;
-
public:
/* Edit Actions. */
enum EditAction {
@@ -1029,6 +1027,8 @@ public:
void set_draw_spaces(bool p_enabled);
bool is_drawing_spaces() const;
+ Color get_font_color() const;
+
TextEdit(const String &p_placeholder = String());
};
diff --git a/scene/resources/syntax_highlighter.cpp b/scene/resources/syntax_highlighter.cpp
index aa311baa43..441c8859cf 100644
--- a/scene/resources/syntax_highlighter.cpp
+++ b/scene/resources/syntax_highlighter.cpp
@@ -419,7 +419,7 @@ void CodeHighlighter::_clear_highlighting_cache() {
}
void CodeHighlighter::_update_cache() {
- font_color = text_edit->theme_cache.font_color;
+ font_color = text_edit->get_font_color();
}
void CodeHighlighter::add_keyword_color(const String &p_keyword, const Color &p_color) {