diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2017-10-15 20:49:38 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-15 20:49:38 +0200 |
commit | 0c9d20104453483fcace18bd22007c87378bd853 (patch) | |
tree | f6478200f4e3fe67fd26c993009f9853d8949249 /editor | |
parent | e498f017fa056cc250f9fb2c585131b6c6eb5c08 (diff) | |
parent | e49ac08c24a9a62c6766fdddcd1f9908002cb013 (diff) |
Merge pull request #11407 from toger5/selection_override_color
added option to keep font color on selection + use consistent selection color in help (fixes: #11501)
Diffstat (limited to 'editor')
-rw-r--r-- | editor/editor_help.cpp | 9 | ||||
-rw-r--r-- | editor/editor_themes.cpp | 6 |
2 files changed, 8 insertions, 7 deletions
diff --git a/editor/editor_help.cpp b/editor/editor_help.cpp index 20ffbde378..2c4d3035a4 100644 --- a/editor/editor_help.cpp +++ b/editor/editor_help.cpp @@ -1699,7 +1699,7 @@ void EditorHelp::_notification(int p_what) { case EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED: { - class_desc->add_color_override("selection_color", EDITOR_DEF("text_editor/highlighting/selection_color", Color(0.2, 0.2, 1))); + class_desc->add_color_override("selection_color", get_color("text_editor/theme/selection_color", "Editor")); } break; @@ -1788,7 +1788,7 @@ EditorHelp::EditorHelp() { class_desc = memnew(RichTextLabel); vbc->add_child(class_desc); class_desc->set_v_size_flags(SIZE_EXPAND_FILL); - class_desc->add_color_override("selection_color", EDITOR_DEF("text_editor/highlighting/selection_color", Color(0.2, 0.2, 1))); + class_desc->add_color_override("selection_color", get_color("text_editor/theme/selection_color", "Editor")); class_desc->connect("meta_clicked", this, "_class_desc_select"); class_desc->connect("gui_input", this, "_class_desc_input"); } @@ -1879,7 +1879,7 @@ void EditorHelpBit::_notification(int p_what) { switch (p_what) { case EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED: { - rich_text->add_color_override("selection_color", EDITOR_DEF("text_editor/highlighting/selection_color", Color(0.2, 0.2, 1))); + rich_text->add_color_override("selection_color", get_color("text_editor/theme/selection_color", "Editor")); } break; default: break; @@ -1898,6 +1898,7 @@ EditorHelpBit::EditorHelpBit() { add_child(rich_text); rich_text->set_anchors_and_margins_preset(Control::PRESET_WIDE); rich_text->connect("meta_clicked", this, "_meta_clicked"); - rich_text->add_color_override("selection_color", EDITOR_DEF("text_editor/highlighting/selection_color", Color(0.2, 0.2, 1))); + rich_text->add_color_override("selection_color", get_color("text_editor/theme/selection_color", "Editor")); + rich_text->set_override_selected_font_color(false); set_custom_minimum_size(Size2(0, 70 * EDSCALE)); } diff --git a/editor/editor_themes.cpp b/editor/editor_themes.cpp index 3fc1dcb0bd..13ed7a7f30 100644 --- a/editor/editor_themes.cpp +++ b/editor/editor_themes.cpp @@ -972,8 +972,8 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) { const Color dim_color = Color(font_color.r, font_color.g, font_color.b, 0.5); const float mono_value = mono_color.r; - const Color alpha1 = Color(mono_value, mono_value, mono_value, 0.1); - const Color alpha2 = Color(mono_value, mono_value, mono_value, 0.3); + const Color alpha1 = Color(mono_value, mono_value, mono_value, 0.07); + const Color alpha2 = Color(mono_value, mono_value, mono_value, 0.14); const Color alpha3 = Color(mono_value, mono_value, mono_value, 0.5); const Color alpha4 = Color(mono_value, mono_value, mono_value, 0.7); @@ -998,7 +998,7 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) { const Color caret_color = mono_color; const Color caret_background_color = mono_color.inverted(); const Color text_selected_color = dark_color_3; - const Color selection_color = alpha3; + const Color selection_color = alpha2; const Color brace_mismatch_color = error_color; const Color current_line_color = alpha1; const Color line_length_guideline_color = warning_color; |