From dcf1d9fcf9ce6c45bbdae5953fb1b3799368005d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20Br=C3=BCbach?= <44814898+BruebachL@users.noreply.github.com> Date: Sat, 7 Nov 2026 10:26:37 +0100 Subject: [PATCH] [Icons] Adapt the treatment preview to the authored roles The preview file is inherited from the treatment PR. Here the palette already authors the fill tone and the badge takes an explicit scheme, so the generator stops re-saturating the role and passes the scheme the sheet renders. --- tests/theme_migration/icon_treatment_preview_test.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tests/theme_migration/icon_treatment_preview_test.cpp b/tests/theme_migration/icon_treatment_preview_test.cpp index 212987ec0..1d027a9e7 100644 --- a/tests/theme_migration/icon_treatment_preview_test.cpp +++ b/tests/theme_migration/icon_treatment_preview_test.cpp @@ -187,9 +187,10 @@ TEST(IconTreatmentPreview, WritesOneSheetPerShippedTheme) qreal y = panelTop + PANEL_TITLE + COLUMN_HEADER; for (const Family &family : families) { - const QColor raw = config.appColors.value(family.role, defaultAppColor(family.role, dark)); - ASSERT_TRUE(raw.isValid()) << theme.toStdString() << " " << family.name; - const QColor tone = ThemeIconFill::saturated(raw); + // The authored role is the tone the filled shape carries; the + // treatments apply their own fill rule from it. + const QColor tone = config.appColors.value(family.role, defaultAppColor(family.role, dark)); + ASSERT_TRUE(tone.isValid()) << theme.toStdString() << " " << family.name; for (int state = 0; state < 2; ++state) { const bool isDisabled = state == 1; @@ -221,7 +222,9 @@ TEST(IconTreatmentPreview, WritesOneSheetPerShippedTheme) if (treatment == 1) { return ThemeIconSticker::renderSticker(svg, ink, pixelSize); } - return ThemeIconBadge::renderBadge(svg, ink, pixelSize); + return ThemeIconBadge::renderBadge(svg, ink, pixelSize, + dark ? ThemeIconFill::Scheme::Dark + : ThemeIconFill::Scheme::Light); }); const qreal x = cellX + 6 + static_cast(glyphIndex) * SLOT + (SLOT - side) / 2.0;