Repository: godotengine/godot
File: editor/inspector/editor_inspector.cpp (C++)

Code before:
	p_cache.key_padding_size = int(EDITOR_GET("interface/theme/base_spacing")) * 2;

	p_cache.warning_color = p_control->get_theme_color(SNAME("warning_color"), EditorStringName(Editor));
	p_cache.prop_subsection = p_control->get_theme_color(SNAME("prop_subsection"), EditorStringName(Editor));
	p_cache.font_color = p_control->get_theme_color(SceneStringName(font_color), EditorStringName(Editor));
	p_cache.font_disabled_color = p_control->get_theme_color(SNAME("font_disabled_color"), EditorStringName(Editor));
	p_cache.font_hover_color = p_control->get_theme_color(SNAME("font_hover_color"), EditorStringName(Editor));
	p_cache.font_pressed_color = p_control->get_theme_color(SNAME("font_pressed_color"), EditorStringName(Editor));
	p_cache.font_hover_pressed_color = p_control->get_theme_color(SNAME("font_hover_pressed_color"), EditorStringName(Editor));

	p_cache.font = p_control->get_theme_font(SceneStringName(font), SNAME("Tree"));
	p_cache.font_size = p_control->get_theme_font_size(SceneStringName(font_size), SNAME("Tree"));
	p_cache.bold_font = p_control->get_theme_font(SNAME("bold"), EditorStringName(EditorFonts));
	p_cache.bold_font_size = p_control->get_theme_font_size(SNAME("bold_size"), EditorStringName(EditorFonts));
	p_cache.light_font = p_control->get_theme_font(SNAME("main"), EditorStringName(EditorFonts));
	p_cache.light_font_size = p_control->get_theme_font_size(SNAME("main_size"), EditorStringName(EditorFonts));

	p_cache.arrow = p_control->get_theme_icon(SNAME("arrow"), SNAME("Tree"));
	p_cache.arrow_collapsed = p_control->get_theme_icon(SNAME("arrow_collapsed"), SNAME("Tree"));
	p_cache.arrow_collapsed_mirrored = p_control->get_theme_icon(SNAME("arrow_collapsed_mirrored"), SNAME("Tree"));
	p_cache.icon_gui_checked = p_control->get_editor_theme_icon(SNAME("GuiChecked"));
	p_cache.icon_gui_unchecked = p_control->get_editor_theme_icon(SNAME("GuiUnchecked"));
	p_cache.icon_gui_animation_key = p_control->get_editor_theme_icon(SNAME("Key"));

	p_cache.indent_box = p_control->get_theme_stylebox(SNAME("indent_box"), SNAME("EditorInspectorSection"));
	p_cache.key_hover = p_control->get_theme_stylebox(SceneStringName(hover), "FlatButton");
}

void EditorInspector::initialize_category_theme(EditorInspectorCategory::ThemeCache &p_cache, Control *p_control) {
	EditorInspector *parent_inspector = _get_control_parent_inspector(p_control);
	if (parent_inspector && parent_inspector != p_control) {
		p_cache = parent_inspector->category_theme_cache;
		return;
	}

	p_cache.horizontal_separation = p_control->get_theme_constant(SNAME("h_separation"), SNAME("Tree"));
	p_cache.vertical_separation = p_control->get_theme_constant(SNAME("v_separation"), SNAME("Tree"));
	p_cache.class_icon_size = p_control->get_theme_constant(SNAME("class_icon_size"), EditorStringName(Editor));

	p_cache.font_color = p_control->get_theme_color(SceneStringName(font_color), SNAME("Tree"));

	p_cache.bold_font = p_control->get_theme_font(SNAME("bold"), EditorStringName(EditorFonts));
	p_cache.bold_font_size = p_control->get_theme_font_size(SNAME("bold_size"), EditorStringName(EditorFonts));

	p_cache.icon_favorites = p_control->get_editor_theme_icon(SNAME("Favorites"));
	p_cache.icon_unfavorite = p_control->get_editor_theme_icon(SNAME("Unfavorite"));
	p_cache.icon_help = p_control->get_editor_theme_icon(SNAME("Help"));

	p_cache.background = p_control->get_theme_stylebox(SNAME("bg"), SNAME("EditorInspectorCategory"));
}


Review comment (performance):
```suggestion
	p_cache.key_hover = p_control->get_theme_stylebox(SceneStringName(hover), SceneStringName(FlatButton));
```

Code after:
	}

	p_cache.horizontal_separation = p_control->get_theme_constant(SNAME("h_separation"), SNAME("EditorInspectorSection"));
	p_cache.vertical_separation = p_control->get_theme_constant(SNAME("v_separation"), SNAME("Tree"));
	p_cache.inspector_margin = p_control->get_theme_constant(SNAME("inspector_margin"), EditorStringName(Editor));
	p_cache.indent_size = p_control->get_theme_constant(SNAME("indent_size"), SNAME("EditorInspectorSection"));
	p_cache.key_padding_size = int(EDITOR_GET("interface/theme/base_spacing")) * 2;

	p_cache.warning_color = p_control->get_theme_color(SNAME("warning_color"), EditorStringName(Editor));
	p_cache.prop_subsection = p_control->get_theme_color(SNAME("prop_subsection"), EditorStringName(Editor));
	p_cache.font_color = p_control->get_theme_color(SceneStringName(font_color), EditorStringName(Editor));
	p_cache.font_disabled_color = p_control->get_theme_color(SNAME("font_disabled_color"), EditorStringName(Editor));
	p_cache.font_hover_color = p_control->get_theme_color(SNAME("font_hover_color"), EditorStringName(Editor));
	p_cache.font_pressed_color = p_control->get_theme_color(SNAME("font_pressed_color"), EditorStringName(Editor));
	p_cache.font_hover_pressed_color = p_control->get_theme_color(SNAME("font_hover_pressed_color"), EditorStringName(Editor));

	p_cache.font = p_control->get_theme_font(SceneStringName(font), SNAME("Tree"));
	p_cache.font_size = p_control->get_theme_font_size(SceneStringName(font_size), SNAME("Tree"));
	p_cache.bold_font = p_control->get_theme_font(SNAME("bold"), EditorStringName(EditorFonts));
	p_cache.bold_font_size = p_control->get_theme_font_size(SNAME("bold_size"), EditorStringName(EditorFonts));
	p_cache.light_font = p_control->get_theme_font(SNAME("main"), EditorStringName(EditorFonts));
	p_cache.light_font_size = p_control->get_theme_font_size(SNAME("main_size"), EditorStringName(EditorFonts));

	p_cache.arrow = p_control->get_theme_icon(SNAME("arrow"), SNAME("Tree"));
	p_cache.arrow_collapsed = p_control->get_theme_icon(SNAME("arrow_collapsed"), SNAME("Tree"));
	p_cache.arrow_collapsed_mirrored = p_control->get_theme_icon(SNAME("arrow_collapsed_mirrored"), SNAME("Tree"));
	p_cache.icon_gui_checked = p_control->get_editor_theme_icon(SNAME("GuiChecked"));
	p_cache.icon_gui_unchecked = p_control->get_editor_theme_icon(SNAME("GuiUnchecked"));
	p_cache.icon_gui_animation_key = p_control->get_editor_theme_icon(SNAME("Key"));

	p_cache.indent_box = p_control->get_theme_stylebox(SNAME("indent_box"), SNAME("EditorInspectorSection"));
	p_cache.key_hover = p_control->get_theme_stylebox(SceneStringName(hover), SceneStringName(FlatButton));
}

void EditorInspector::initialize_category_theme(EditorInspectorCategory::ThemeCache &p_cache, Control *p_control) {
	EditorInspector *parent_inspector = _get_control_parent_inspector(p_control);
	if (parent_inspector && parent_inspector != p_control) {
		p_cache = parent_inspector->category_theme_cache;
		return;
	}

	p_cache.horizontal_separation = p_control->get_theme_constant(SNAME("h_separation"), SNAME("Tree"));
	p_cache.vertical_separation = p_control->get_theme_constant(SNAME("v_separation"), SNAME("Tree"));
	p_cache.class_icon_size = p_control->get_theme_constant(SNAME("class_icon_size"), EditorStringName(Editor));

	p_cache.font_color = p_control->get_theme_color(SceneStringName(font_color), SNAME("Tree"));

	p_cache.bold_font = p_control->get_theme_font(SNAME("bold"), EditorStringName(EditorFonts));
	p_cache.bold_font_size = p_control->get_theme_font_size(SNAME("bold_size"), EditorStringName(EditorFonts));

	p_cache.icon_favorites = p_control->get_editor_theme_icon(SNAME("Favorites"));