summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2019-11-14 12:38:04 +0100
committerGitHub <noreply@github.com>2019-11-14 12:38:04 +0100
commitf244772028f6a53aea828da799039b5dd8d77aec (patch)
tree0c272e6317c44ea34bedda4a38bf250fa585dace
parent41634199c8dcaa8b72586933038acf48919ddcc0 (diff)
parent0ec76d40b45d220bcc5d0cdff07f1278c7409f22 (diff)
Merge pull request #33617 from Chaosus/fix_theme_element2
Fix incorrect error/matches label color when switching from light to dark theme
-rw-r--r--editor/code_editor.cpp7
-rw-r--r--editor/editor_help.cpp1
2 files changed, 6 insertions, 2 deletions
diff --git a/editor/code_editor.cpp b/editor/code_editor.cpp
index 7d47568c41..16780a795f 100644
--- a/editor/code_editor.cpp
+++ b/editor/code_editor.cpp
@@ -108,6 +108,8 @@ void FindReplaceBar::_notification(int p_what) {
hide_button->set_hover_texture(get_icon("Close", "EditorIcons"));
hide_button->set_pressed_texture(get_icon("Close", "EditorIcons"));
hide_button->set_custom_minimum_size(hide_button->get_normal_texture()->get_size());
+ } else if (p_what == NOTIFICATION_THEME_CHANGED) {
+ matches_label->add_color_override("font_color", results_count > 0 ? get_color("font_color", "Label") : get_color("error_color", "Editor"));
}
}
@@ -1443,6 +1445,9 @@ void CodeTextEditor::_update_font() {
text_editor->add_font_override("font", get_font("source", "EditorFonts"));
+ error->add_font_override("font", get_font("status_source", "EditorFonts"));
+ error->add_color_override("font_color", get_color("error_color", "Editor"));
+
Ref<Font> status_bar_font = get_font("status_source", "EditorFonts");
error->add_font_override("font", status_bar_font);
int count = status_bar->get_child_count();
@@ -1677,8 +1682,6 @@ CodeTextEditor::CodeTextEditor() {
error = memnew(Label);
scroll->add_child(error);
error->set_v_size_flags(SIZE_EXPAND | SIZE_SHRINK_CENTER);
- error->add_color_override("font_color", EditorNode::get_singleton()->get_gui_base()->get_color("error_color", "Editor"));
- error->add_font_override("font", EditorNode::get_singleton()->get_gui_base()->get_font("status_source", "EditorFonts"));
error->set_mouse_filter(MOUSE_FILTER_STOP);
error->connect("gui_input", this, "_error_pressed");
find_replace_bar->connect("error", error, "set_text");
diff --git a/editor/editor_help.cpp b/editor/editor_help.cpp
index cf54847922..4f7432cd65 100644
--- a/editor/editor_help.cpp
+++ b/editor/editor_help.cpp
@@ -1716,6 +1716,7 @@ void FindBar::_notification(int p_what) {
hide_button->set_hover_texture(get_icon("Close", "EditorIcons"));
hide_button->set_pressed_texture(get_icon("Close", "EditorIcons"));
hide_button->set_custom_minimum_size(hide_button->get_normal_texture()->get_size());
+ matches_label->add_color_override("font_color", results_count > 0 ? get_color("font_color", "Label") : get_color("error_color", "Editor"));
} break;
case NOTIFICATION_VISIBILITY_CHANGED: {