Use the accent color to highlight selected text
This makes selections easier to see, while making them fit better
within the editor theme.
This closes #22552.
(cherry picked from commit 9ba6738719
)
This commit is contained in:
parent
d538fb8d6c
commit
93875a79bb
|
@ -48,11 +48,12 @@ void EditorHelp::_init_colors() {
|
|||
text_color = get_color("default_color", "RichTextLabel");
|
||||
headline_color = get_color("headline_color", "EditorHelp");
|
||||
base_type_color = title_color.linear_interpolate(text_color, 0.5);
|
||||
comment_color = Color(text_color.r, text_color.g, text_color.b, 0.6);
|
||||
comment_color = text_color * Color(1, 1, 1, 0.6);
|
||||
symbol_color = comment_color;
|
||||
value_color = Color(text_color.r, text_color.g, text_color.b, 0.4);
|
||||
qualifier_color = Color(text_color.r, text_color.g, text_color.b, 0.8);
|
||||
value_color = text_color * Color(1, 1, 1, 0.4);
|
||||
qualifier_color = text_color * Color(1, 1, 1, 0.8);
|
||||
type_color = get_color("accent_color", "Editor").linear_interpolate(text_color, 0.5);
|
||||
class_desc->add_color_override("selection_color", get_color("accent_color", "Editor") * Color(1, 1, 1, 0.4));
|
||||
}
|
||||
|
||||
void EditorHelp::_unhandled_key_input(const Ref<InputEvent> &p_ev) {
|
||||
|
@ -1340,19 +1341,11 @@ void EditorHelp::_notification(int p_what) {
|
|||
|
||||
switch (p_what) {
|
||||
|
||||
case NOTIFICATION_READY: {
|
||||
|
||||
_update_doc();
|
||||
|
||||
} break;
|
||||
|
||||
case NOTIFICATION_READY:
|
||||
case EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED: {
|
||||
|
||||
class_desc->add_color_override("selection_color", EditorSettings::get_singleton()->get("text_editor/theme/selection_color"));
|
||||
_update_doc();
|
||||
|
||||
} break;
|
||||
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
|
@ -1426,7 +1419,7 @@ EditorHelp::EditorHelp() {
|
|||
class_desc = memnew(RichTextLabel);
|
||||
add_child(class_desc);
|
||||
class_desc->set_v_size_flags(SIZE_EXPAND_FILL);
|
||||
class_desc->add_color_override("selection_color", EditorSettings::get_singleton()->get("text_editor/theme/selection_color"));
|
||||
class_desc->add_color_override("selection_color", get_color("accent_color", "Editor") * Color(1, 1, 1, 0.4));
|
||||
class_desc->connect("meta_clicked", this, "_class_desc_select");
|
||||
class_desc->connect("gui_input", this, "_class_desc_input");
|
||||
|
||||
|
@ -1491,7 +1484,7 @@ void EditorHelpBit::_notification(int p_what) {
|
|||
switch (p_what) {
|
||||
case EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED: {
|
||||
|
||||
rich_text->add_color_override("selection_color", EditorSettings::get_singleton()->get("text_editor/theme/selection_color"));
|
||||
rich_text->add_color_override("selection_color", get_color("accent_color", "Editor") * Color(1, 1, 1, 0.4));
|
||||
} break;
|
||||
|
||||
default: break;
|
||||
|
@ -1509,7 +1502,7 @@ EditorHelpBit::EditorHelpBit() {
|
|||
rich_text = memnew(RichTextLabel);
|
||||
add_child(rich_text);
|
||||
rich_text->connect("meta_clicked", this, "_meta_clicked");
|
||||
rich_text->add_color_override("selection_color", EditorSettings::get_singleton()->get("text_editor/theme/selection_color"));
|
||||
rich_text->add_color_override("selection_color", get_color("accent_color", "Editor") * Color(1, 1, 1, 0.4));
|
||||
rich_text->set_override_selected_font_color(false);
|
||||
set_custom_minimum_size(Size2(0, 70 * EDSCALE));
|
||||
}
|
||||
|
|
|
@ -407,7 +407,6 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) {
|
|||
_initial_set("text_editor/theme/color_theme", "Adaptive");
|
||||
hints["text_editor/theme/color_theme"] = PropertyInfo(Variant::STRING, "text_editor/theme/color_theme", PROPERTY_HINT_ENUM, "Adaptive,Default,Custom");
|
||||
_initial_set("text_editor/theme/line_spacing", 6);
|
||||
_initial_set("text_editor/theme/selection_color", Color::html("40808080"));
|
||||
|
||||
_load_default_text_editor_theme();
|
||||
|
||||
|
@ -635,7 +634,7 @@ void EditorSettings::_load_default_text_editor_theme() {
|
|||
_initial_set("text_editor/highlighting/caret_color", Color::html("aaaaaa"));
|
||||
_initial_set("text_editor/highlighting/caret_background_color", Color::html("000000"));
|
||||
_initial_set("text_editor/highlighting/text_selected_color", Color::html("000000"));
|
||||
_initial_set("text_editor/highlighting/selection_color", Color::html("6ca9c2"));
|
||||
_initial_set("text_editor/highlighting/selection_color", Color::html("5a699ce8"));
|
||||
_initial_set("text_editor/highlighting/brace_mismatch_color", Color(1, 0.2, 0.2));
|
||||
_initial_set("text_editor/highlighting/current_line_color", Color(0.3, 0.5, 0.8, 0.15));
|
||||
_initial_set("text_editor/highlighting/line_length_guideline_color", Color(0.3, 0.5, 0.8, 0.1));
|
||||
|
|
|
@ -329,7 +329,7 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
|
|||
const Color font_color = mono_color.linear_interpolate(base_color, 0.25);
|
||||
const Color font_color_hl = mono_color.linear_interpolate(base_color, 0.15);
|
||||
const Color font_color_disabled = Color(mono_color.r, mono_color.g, mono_color.b, 0.3);
|
||||
const Color font_color_selection = Color::html("#7d7d7d");
|
||||
const Color font_color_selection = accent_color * Color(1, 1, 1, 0.4);
|
||||
const Color color_disabled = mono_color.inverted().linear_interpolate(base_color, 0.7);
|
||||
const Color color_disabled_bg = mono_color.inverted().linear_interpolate(base_color, 0.9);
|
||||
|
||||
|
@ -821,6 +821,7 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
|
|||
theme->set_stylebox("read_only", "LineEdit", style_widget_disabled);
|
||||
theme->set_color("read_only", "LineEdit", font_color_disabled);
|
||||
theme->set_color("font_color", "LineEdit", font_color);
|
||||
theme->set_color("font_color_selected", "LineEdit", mono_color);
|
||||
theme->set_color("cursor_color", "LineEdit", font_color);
|
||||
theme->set_color("selection_color", "LineEdit", font_color_selection);
|
||||
theme->set_color("clear_button_color", "LineEdit", font_color);
|
||||
|
@ -1105,7 +1106,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 = alpha2;
|
||||
const Color selection_color = accent_color * Color(1, 1, 1, 0.35);
|
||||
const Color brace_mismatch_color = error_color;
|
||||
const Color current_line_color = alpha1;
|
||||
const Color line_length_guideline_color = dark_theme ? base_color : background_color;
|
||||
|
|
Loading…
Reference in New Issue