Merge pull request #119635 from YeldhamDev/flip_those_ratings

Improve the look of the asset rating indicator
This commit is contained in:
Thaddeus Crews committed 2026-05-25 11:19:04 -05:00
commit 5d0ddf6803
4 files changed
+26 -13

No files matched your search

@@ -224,6 +224,8 @@ EditorAssetLibraryItem::EditorAssetLibraryItem(bool p_clickable) {
author_license_hbox->add_child(license);
license->connect(SceneStringName(pressed), callable_mp(this, &EditorAssetLibraryItem::_license_clicked));
vb->add_spacer();
HBoxContainer *rating_hbox = memnew(HBoxContainer);
rating_hbox->set_mouse_filter(MOUSE_FILTER_IGNORE);
vb->add_child(rating_hbox);
@@ -235,11 +237,12 @@ EditorAssetLibraryItem::EditorAssetLibraryItem(bool p_clickable) {
rating_count = memnew(Label);
rating_count->set_mouse_filter(MOUSE_FILTER_STOP);
rating_count->set_theme_type_variation("LabelNoMargin");
rating_count->set_tooltip_text(TTRC("Review Score"));
rating_count->set_accessibility_name(TTRC("Review score"));
rating_count->set_accessibility_name(TTRC("Review Score"));
rating_hbox->add_child(rating_count);
set_accessibility_name(TTRC("Open asset details"));
set_accessibility_name(TTRC("Open Asset Details"));
set_custom_minimum_size(Size2(250, 80) * EDSCALE);
set_h_size_flags(SIZE_EXPAND_FILL);
}
@@ -944,7 +947,7 @@ EditorAssetLibraryItemDownload::EditorAssetLibraryItemDownload() {
vb->add_child(title_hb);
title = memnew(Label);
title->set_text_overrun_behavior(TextServer::OVERRUN_TRIM_ELLIPSIS);
title->set_theme_type_variation("LabelVMarginless");
title->set_theme_type_variation("LabelNoMarginVertical");
title->set_focus_mode(FOCUS_ACCESSIBILITY);
title->set_h_size_flags(Control::SIZE_EXPAND_FILL);
title_hb->add_child(title);
@@ -956,7 +959,7 @@ EditorAssetLibraryItemDownload::EditorAssetLibraryItemDownload() {
version = memnew(Label);
version->set_auto_translate_mode(AUTO_TRANSLATE_MODE_DISABLED);
version->set_theme_type_variation("LabelVMarginless");
version->set_theme_type_variation("LabelNoMarginVertical");
vb->add_child(version);
spacer = memnew(Control);
+1 -1
View File
@@ -1 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16"><path fill="#e9afaf" d="M1 7v8M4 15V7" paint-order="fill markers stroke"/><path fill="#e0e0e0" d="M2 7v7H4V7ZM6 7v7h5c2 0 3-4 3-6C14 7 13 6 11.724183 6H10C10 5 12 1 9 1 8.462842 2.9756415 7 6 6 7Z" paint-order="fill markers stroke"/></svg>
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16"><path fill="#e9afaf" d="M1 7v8M4 15V7" paint-order="fill markers stroke"/><path fill="#e0e0e0" d="m 14,7 v 7 H 12 V 7 Z m -4,0 v 7 H 5 C 3,14 2,10 2,8 2,7 3,6 4.275817,6 H 6 C 6,5 4,1 7,1 7.537158,2.9756415 9,6 10,7 Z" paint-order="fill markers stroke"/></svg>

Before

Width:  |  Height:  |  Size: 303 B

After

Width:  |  Height:  |  Size: 324 B

+9 -4
View File
@@ -1237,11 +1237,16 @@ void ThemeClassic::populate_standard_styles(const Ref<EditorTheme> &p_theme, Edi
p_theme->set_constant("line_spacing", "Label", 3 * EDSCALE);
p_theme->set_constant("outline_size", "Label", 0);
// Label with no vertical margins.
// Label with different margins.
p_theme->set_type_variation("LabelVMarginless", "Label");
Ref<StyleBoxEmpty> v_marginless_style = EditorThemeManager::make_empty_stylebox(p_config.base_empty_style->get_margin(SIDE_LEFT), 0, p_config.base_empty_style->get_margin(SIDE_RIGHT), 0);
p_theme->set_stylebox(CoreStringName(normal), "LabelVMarginless", v_marginless_style);
p_theme->set_type_variation("LabelNoMargin", "Label");
p_theme->set_stylebox(CoreStringName(normal), "LabelNoMargin", EditorThemeManager::make_empty_stylebox());
p_theme->set_type_variation("LabelNoMarginVertical", "Label");
Ref<StyleBoxEmpty> no_v_margin_style = p_config.base_empty_style->duplicate();
no_v_margin_style->set_content_margin(SIDE_TOP, 0);
no_v_margin_style->set_content_margin(SIDE_BOTTOM, 0);
p_theme->set_stylebox(CoreStringName(normal), "LabelNoMarginVertical", no_v_margin_style);
}
// SpinBox.
+9 -4
View File
@@ -1238,11 +1238,16 @@ void ThemeModern::populate_standard_styles(const Ref<EditorTheme> &p_theme, Edit
p_theme->set_constant("line_spacing", "Label", 3 * EDSCALE);
p_theme->set_constant("outline_size", "Label", 0);
// Label with no vertical margins.
// Label with different margins.
p_theme->set_type_variation("LabelVMarginless", "Label");
Ref<StyleBoxEmpty> v_marginless_style = EditorThemeManager::make_empty_stylebox(label_style->get_margin(SIDE_LEFT), 0, label_style->get_margin(SIDE_RIGHT), 0);
p_theme->set_stylebox(CoreStringName(normal), "LabelVMarginless", v_marginless_style);
p_theme->set_type_variation("LabelNoMargin", "Label");
p_theme->set_stylebox(CoreStringName(normal), "LabelNoMargin", p_config.base_empty_style);
p_theme->set_type_variation("LabelNoMarginVertical", "Label");
Ref<StyleBoxEmpty> no_v_margin_style = label_style->duplicate();
no_v_margin_style->set_content_margin(SIDE_TOP, 0);
no_v_margin_style->set_content_margin(SIDE_BOTTOM, 0);
p_theme->set_stylebox(CoreStringName(normal), "LabelNoMarginVertical", no_v_margin_style);
}
// SpinBox.