Connect `CodeHighlighter` with `TextEdit` without friend-access
This commit is contained in:
parent
571cd0eb79
commit
fee1fb8290
|
@ -6018,6 +6018,10 @@ bool TextEdit::is_drawing_spaces() const {
|
||||||
return draw_spaces;
|
return draw_spaces;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Color TextEdit::get_font_color() const {
|
||||||
|
return theme_cache.font_color;
|
||||||
|
}
|
||||||
|
|
||||||
void TextEdit::_bind_methods() {
|
void TextEdit::_bind_methods() {
|
||||||
/* Internal. */
|
/* Internal. */
|
||||||
|
|
||||||
|
|
|
@ -41,8 +41,6 @@
|
||||||
class TextEdit : public Control {
|
class TextEdit : public Control {
|
||||||
GDCLASS(TextEdit, Control);
|
GDCLASS(TextEdit, Control);
|
||||||
|
|
||||||
friend class CodeHighlighter;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/* Edit Actions. */
|
/* Edit Actions. */
|
||||||
enum EditAction {
|
enum EditAction {
|
||||||
|
@ -1029,6 +1027,8 @@ public:
|
||||||
void set_draw_spaces(bool p_enabled);
|
void set_draw_spaces(bool p_enabled);
|
||||||
bool is_drawing_spaces() const;
|
bool is_drawing_spaces() const;
|
||||||
|
|
||||||
|
Color get_font_color() const;
|
||||||
|
|
||||||
TextEdit(const String &p_placeholder = String());
|
TextEdit(const String &p_placeholder = String());
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -419,7 +419,7 @@ void CodeHighlighter::_clear_highlighting_cache() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void CodeHighlighter::_update_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) {
|
void CodeHighlighter::add_keyword_color(const String &p_keyword, const Color &p_color) {
|
||||||
|
|
Loading…
Reference in New Issue