[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,12 +1,12 @@
#include "settings_button_widget.h"
#include "../../pixel_map_generator.h"
#include "../../theme_icon.h"
#include "settings_popup_widget.h"
#include <QApplication>
#include <QHBoxLayout>
#include <QIcon>
#include <QMouseEvent>
#include <QPixmap>
#include <QPoint>
#include <QPointF>
#include <QRect>
@ -20,7 +20,7 @@
SettingsButtonWidget::SettingsButtonWidget(QWidget *parent)
: QWidget(parent), button(new QToolButton(this)), popup(new SettingsPopupWidget(nullptr))
{
button->setIcon(themePixmap(QStringLiteral("icons/cogwheel")));
button->setIcon(loadThemedIcon(QStringLiteral("icons/settings")));
button->setCheckable(true);
button->setFixedSize(32, 32);
connect(button, &QToolButton::clicked, this, &SettingsButtonWidget::togglePopup);
@ -49,9 +49,9 @@ void SettingsButtonWidget::removeSettingsWidget(QWidget *toRemove) const
popup->removeSettingsWidget(toRemove);
}
void SettingsButtonWidget::setButtonIcon(QPixmap iconMap)
void SettingsButtonWidget::setButtonIcon(const QIcon &icon)
{
button->setIcon(iconMap);
button->setIcon(icon);
}
void SettingsButtonWidget::setButtonText(const QString &text)

View file

@ -13,7 +13,7 @@
#include <qtmetamacros.h>
class QHBoxLayout;
class QPixmap;
class QIcon;
class QToolButton;
class SettingsPopupWidget;
@ -28,7 +28,7 @@ public:
void addSettingsWidget(QWidget *toAdd) const;
void removeSettingsWidget(QWidget *toRemove) const;
void setButtonIcon(QPixmap iconMap);
void setButtonIcon(const QIcon &icon);
void setButtonText(const QString &buttonText);
void setCompact(bool compact);
bool isCompact() const