Repository: godotengine/godot
File: editor/script/script_text_editor.cpp (C++)

Code before:
	code_editor->get_text_editor()->set_gutter_draw(connection_gutter, false);
	code_editor->get_text_editor()->set_gutter_overwritable(connection_gutter, true);
	code_editor->get_text_editor()->set_gutter_type(connection_gutter, TextEdit::GUTTER_TYPE_ICON);

	errors_panel = memnew(RichTextLabel);
	errors_panel->set_custom_minimum_size(Size2(0, 100 * EDSCALE));
	errors_panel->set_h_size_flags(SIZE_EXPAND_FILL);
	errors_panel->set_meta_underline(true);
	errors_panel->set_selection_enabled(true);
	errors_panel->set_context_menu_enabled(true);
	errors_panel->set_focus_mode(FOCUS_CLICK);
	errors_panel->hide();

	drag_info_label = memnew(Label);
	drag_info_label->set_anchors_preset(Control::PRESET_BOTTOM_RIGHT);
	drag_info_label->set_focus_mode(FOCUS_ACCESSIBILITY);
	drag_info_label->add_theme_constant_override("line_spacing", 0);

	Ref<StyleBoxFlat> drag_info_sb;
	drag_info_sb.instantiate();
	drag_info_sb->set_border_width_all(2 * EDSCALE);
	drag_info_sb->set_corner_radius_all(5 * EDSCALE);
	drag_info_sb->set_corner_detail(5);
	drag_info_sb->set_expand_margin_all(5);
	drag_info_label->add_theme_style_override(CoreStringName(normal), drag_info_sb);
	set_drop_info_colors();

	code_editor->get_text_editor()->connect(SceneStringName(mouse_exited), callable_mp(this, &ScriptTextEditor::_on_mouse_exited));
	code_editor->get_text_editor()->add_child(drag_info_label);
	drag_info_label->hide();

	code_editor->get_text_editor()->set_symbol_lookup_on_click_enabled(true);
	code_editor->get_text_editor()->set_symbol_tooltip_on_hover_enabled(true);

	color_panel = memnew(PopupPanel);

	inline_color_popup = memnew(PopupPanel);
	add_child(inline_color_popup);

	inline_color_picker = memnew(ColorPicker);
	inline_color_picker->set_mouse_filter(MOUSE_FILTER_STOP);
	inline_color_picker->set_deferred_mode(true);
	inline_color_picker->set_hex_visible(false);
	inline_color_picker->connect("color_changed", callable_mp(this, &ScriptTextEditor::_picker_color_changed));
	inline_color_popup->add_child(inline_color_picker);

	inline_color_options = memnew(OptionButton);
	inline_color_options->set_h_size_flags(SIZE_FILL);
	inline_color_options->set_text_overrun_behavior(TextServer::OVERRUN_TRIM_ELLIPSIS);
	inline_color_options->set_fit_to_longest_item(false);
	inline_color_options->connect("item_selected", callable_mp(this, &ScriptTextEditor::_update_color_text).unbind(1));

Review comment (suggestion):
The `_load_theme_settings()` is called at the beginning, so the info colors don't need to be updated in the constructor, and consequently, this doesn't need to be a separate method.

Code after:
	errors_panel = memnew(RichTextLabel);
	errors_panel->set_custom_minimum_size(Size2(0, 100 * EDSCALE));
	errors_panel->set_h_size_flags(SIZE_EXPAND_FILL);
	errors_panel->set_meta_underline(true);
	errors_panel->set_selection_enabled(true);
	errors_panel->set_context_menu_enabled(true);
	errors_panel->set_focus_mode(FOCUS_CLICK);
	errors_panel->hide();

	drag_info_label = memnew(Label);
	drag_info_label->set_anchors_preset(Control::PRESET_BOTTOM_RIGHT);
	drag_info_label->set_focus_mode(FOCUS_ACCESSIBILITY);
	drag_info_label->add_theme_constant_override("line_spacing", 0);

	Ref<StyleBoxFlat> drag_info_sb;
	drag_info_sb.instantiate();
	drag_info_sb->set_border_width_all(2 * EDSCALE);
	drag_info_sb->set_corner_radius_all(5 * EDSCALE);
	drag_info_sb->set_corner_detail(5);
	drag_info_sb->set_expand_margin_all(5);
	drag_info_label->add_theme_style_override(CoreStringName(normal), drag_info_sb);

	code_editor->get_text_editor()->connect(SceneStringName(mouse_exited), callable_mp(this, &ScriptTextEditor::_on_mouse_exited));
	code_editor->get_text_editor()->add_child(drag_info_label);
	drag_info_label->hide();

	code_editor->get_text_editor()->set_symbol_lookup_on_click_enabled(true);
	code_editor->get_text_editor()->set_symbol_tooltip_on_hover_enabled(true);

	color_panel = memnew(PopupPanel);

	inline_color_popup = memnew(PopupPanel);
	add_child(inline_color_popup);

	inline_color_picker = memnew(ColorPicker);
	inline_color_picker->set_mouse_filter(MOUSE_FILTER_STOP);
	inline_color_picker->set_deferred_mode(true);
	inline_color_picker->set_hex_visible(false);
	inline_color_picker->connect("color_changed", callable_mp(this, &ScriptTextEditor::_picker_color_changed));
	inline_color_popup->add_child(inline_color_picker);

	inline_color_options = memnew(OptionButton);
	inline_color_options->set_h_size_flags(SIZE_FILL);
	inline_color_options->set_text_overrun_behavior(TextServer::OVERRUN_TRIM_ELLIPSIS);
	inline_color_options->set_fit_to_longest_item(false);
	inline_color_options->connect("item_selected", callable_mp(this, &ScriptTextEditor::_update_color_text).unbind(1));
	inline_color_picker->get_slider_container()->add_sibling(inline_color_options);

	connection_info_dialog = memnew(ConnectionInfoDialog);

	update_settings();