diff options
Diffstat (limited to 'editor/editor_help.cpp')
-rw-r--r-- | editor/editor_help.cpp | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/editor/editor_help.cpp b/editor/editor_help.cpp index 0e22f0d386..7fa2c53275 100644 --- a/editor/editor_help.cpp +++ b/editor/editor_help.cpp @@ -1712,9 +1712,8 @@ void EditorHelp::_notification(int p_what) { } break; case EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED: { - Ref<StyleBoxFlat> style(memnew(StyleBoxFlat)); - style->set_bg_color(EditorSettings::get_singleton()->get("text_editor/highlighting/background_color")); - background_panel->add_style_override("panel", style); + + class_desc->add_color_override("selection_color", EDITOR_DEF("text_editor/highlighting/selection_color", Color(0.2, 0.2, 1))); } break; default: break; @@ -1786,14 +1785,12 @@ EditorHelp::EditorHelp() { { background_panel = memnew(Panel); - Ref<StyleBoxFlat> style(memnew(StyleBoxFlat)); - style->set_bg_color(EditorSettings::get_singleton()->get("text_editor/highlighting/background_color")); background_panel->set_v_size_flags(SIZE_EXPAND_FILL); - background_panel->add_style_override("panel", style); //get_stylebox("normal","TextEdit")); vbc->add_child(background_panel); class_desc = memnew(RichTextLabel); background_panel->add_child(class_desc); - class_desc->set_area_as_parent_rect(8); + class_desc->set_area_as_parent_rect(); + class_desc->add_color_override("selection_color", EDITOR_DEF("text_editor/highlighting/selection_color", Color(0.2, 0.2, 1))); class_desc->connect("meta_clicked", this, "_class_desc_select"); class_desc->connect("gui_input", this, "_class_desc_input"); } @@ -1882,8 +1879,13 @@ void EditorHelpBit::_bind_methods() { void EditorHelpBit::_notification(int p_what) { - if (p_what == EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED) { - add_style_override("panel", get_stylebox("ScriptPanel", "EditorStyles")); + 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))); + } break; + + default: break; } } @@ -1897,8 +1899,8 @@ EditorHelpBit::EditorHelpBit() { rich_text = memnew(RichTextLabel); add_child(rich_text); - rich_text->set_area_as_parent_rect(8 * EDSCALE); + rich_text->set_area_as_parent_rect(); 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))); set_custom_minimum_size(Size2(0, 70 * EDSCALE)); - add_style_override("panel", EditorNode::get_singleton()->get_gui_base()->get_stylebox("ScriptPanel", "EditorStyles")); } |