Browse Source

Use theme icon size when calculating category minimum size

This previously used the underlying size of the icon, causing the
category to grow incorrectly when re-rendered.

Fixes #82527
Jack Wilsdon 1 year ago
parent
commit
4a33a51ea4
1 changed files with 2 additions and 1 deletions
  1. 2 1
      editor/editor_inspector.cpp

+ 2 - 1
editor/editor_inspector.cpp

@@ -1188,7 +1188,8 @@ Size2 EditorInspectorCategory::get_minimum_size() const {
 	Size2 ms;
 	Size2 ms;
 	ms.height = font->get_height(font_size);
 	ms.height = font->get_height(font_size);
 	if (icon.is_valid()) {
 	if (icon.is_valid()) {
-		ms.height = MAX(icon->get_height(), ms.height);
+		int icon_size = get_theme_constant(SNAME("class_icon_size"), EditorStringName(Editor));
+		ms.height = MAX(icon_size, ms.height);
 	}
 	}
 	ms.height += get_theme_constant(SNAME("v_separation"), SNAME("Tree"));
 	ms.height += get_theme_constant(SNAME("v_separation"), SNAME("Tree"));