[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.
This commit is contained in:
Lukas Brübach 2026-11-07 10:26:37 +01:00
parent 9f7fef0b3a
commit dcf1d9fcf9

View file

@ -187,9 +187,10 @@ TEST(IconTreatmentPreview, WritesOneSheetPerShippedTheme)
qreal y = panelTop + PANEL_TITLE + COLUMN_HEADER; qreal y = panelTop + PANEL_TITLE + COLUMN_HEADER;
for (const Family &family : families) { for (const Family &family : families) {
const QColor raw = config.appColors.value(family.role, defaultAppColor(family.role, dark)); // The authored role is the tone the filled shape carries; the
ASSERT_TRUE(raw.isValid()) << theme.toStdString() << " " << family.name; // treatments apply their own fill rule from it.
const QColor tone = ThemeIconFill::saturated(raw); 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) { for (int state = 0; state < 2; ++state) {
const bool isDisabled = state == 1; const bool isDisabled = state == 1;
@ -221,7 +222,9 @@ TEST(IconTreatmentPreview, WritesOneSheetPerShippedTheme)
if (treatment == 1) { if (treatment == 1) {
return ThemeIconSticker::renderSticker(svg, ink, pixelSize); 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 = const qreal x =
cellX + 6 + static_cast<qreal>(glyphIndex) * SLOT + (SLOT - side) / 2.0; cellX + 6 + static_cast<qreal>(glyphIndex) * SLOT + (SLOT - side) / 2.0;