[Icons] Migrate UI glyphs to palette-token SVGs

Runtime inversion is not a theming system: it rotates hue, breaks duotone art
and mishandles alpha, and a QPixmap snapshot cannot follow a palette change.
Redraw the top-level UI glyph set on a 24x24 grid with `currentColor` as the
paint token, drop Inkscape/Sodipodi cruft, and delete the icons whose metaphor
was duplicated (cogwheel/gear -> settings, scale_balanced -> scales,
update.png -> reload).

Load the glyphs through `loadThemedIcon` so the engine resolves the token from
the palette on every request, and let `themePixmap` use the same resolution for
one-shot pixmaps. `loadColorAdjustedPixmap` is gone; every caller now keeps a
QIcon, which `SettingsButtonWidget::setButtonIcon` accepts instead of a QPixmap.

Content art (mana, counters, countries) keeps its authored colors.

Add a render test covering aspect ratio, palette flips, icon modes and
high-DPI pixmaps.
This commit is contained in:
Lukas Brübach 2026-10-20 11:41:26 +02:00
parent 339c969db8
commit 95537a8ea8
95 changed files with 535 additions and 9681 deletions

View file

@ -1,6 +1,6 @@
#include "visual_deck_display_options_widget.h"
#include "../../pixel_map_generator.h"
#include "../../theme_icon.h"
#include "../deck_editor/deck_editor_deck_dock_widget.h"
#include "../quick_settings/settings_button_widget.h"
#include "../tabs/visual_deck_editor/tab_deck_editor_visual.h"
@ -66,7 +66,7 @@ VisualDeckDisplayOptionsWidget::VisualDeckDisplayOptionsWidget(QWidget *parent)
sortByLabel = new QLabel(this);
sortCriteriaButton = new SettingsButtonWidget(this);
sortCriteriaButton->setButtonIcon(themePixmap(QStringLiteral("icons/sort_arrow_down")));
sortCriteriaButton->setButtonIcon(loadThemedIcon(QStringLiteral("icons/sort_arrow_down")));
sortLabel = new QLabel(sortCriteriaButton);
sortLabel->setWordWrap(true);
@ -111,7 +111,7 @@ void VisualDeckDisplayOptionsWidget::retranslateUi()
sortLabel->setText(tr("Click and drag to change the sort order within the groups"));
sortCriteriaButton->setToolTip(tr("Configure how cards are sorted within their groups"));
displayTypeButton->setButtonText(tr("Toggle Layout: Overlap"));
displayTypeButton->setButtonIcon(themePixmap(QStringLiteral("icons/scales")));
displayTypeButton->setButtonIcon(loadThemedIcon(QStringLiteral("icons/scales")));
displayTypeButton->setToolTip(
tr("Change how cards are displayed within zones (i.e. overlapped or fully visible.)"));
}
@ -136,11 +136,11 @@ void VisualDeckDisplayOptionsWidget::updateDisplayType()
switch (currentDisplayType) {
case DisplayType::Flat:
displayTypeButton->setButtonText(tr("Toggle Layout: Flat"));
displayTypeButton->setButtonIcon(themePixmap(QStringLiteral("icons/scroll")));
displayTypeButton->setButtonIcon(loadThemedIcon(QStringLiteral("icons/scroll")));
break;
case DisplayType::Overlap:
displayTypeButton->setButtonText(tr("Toggle Layout: Overlap"));
displayTypeButton->setButtonIcon(themePixmap(QStringLiteral("icons/scales")));
displayTypeButton->setButtonIcon(loadThemedIcon(QStringLiteral("icons/scales")));
break;
}
emit displayTypeChanged(currentDisplayType);

View file

@ -1,7 +1,7 @@
#include "visual_deck_editor_widget.h"
#include "../../../client/settings/cache_settings.h"
#include "../../pixel_map_generator.h"
#include "../../theme_icon.h"
#include "../cards/card_size_widget.h"
#include "../cards/deck_card_zone_display_widget.h"
#include "../general/layout_containers/flow_widget.h"
@ -143,7 +143,7 @@ void VisualDeckEditorWidget::initializeSearchBarAndCompleter()
// Search button functionality
searchPushButton = new CompactPushButton(searchContainer);
searchPushButton->setButtonIcon(themePixmap(QStringLiteral("icons/search")));
searchPushButton->setButtonIcon(loadThemedIcon(QStringLiteral("icons/search")));
connect(searchPushButton, &QPushButton::clicked, this, [this] { addCardFromSearch(); });
searchLayout->addWidget(searchPushButton);