Cockatrice/cockatrice/src/interface/widgets/utility
BruebachL 627c7a83aa
[Icons] Migrate UI glyphs to palette-token SVGs (#7595)
* [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.

* [Tests] Keep the icon render test QApplication alive until exit

Creating it as a function-local static tears it down before Qt's library statics
at exit, and libQt6Network then runs QObject destructors against freed memory —
a SEGV the sanitizer leg reports after the tests have already passed. Leak the
application instead, the usual pattern for a test binary.

* [Icons] Render lock and dropdown glyphs through the icon engine

Both generators rendered the sentinel SVG to a fixed height x height pixmap
at DPR 1. The pre-migration path rendered larger and let QIcon scale it, so
on a 2x display the games-list lock (13px) and the banner dropdown arrow
(24px) came back crisp; the new path hands the widget a DPR-1 bitmap that
gets upscaled and blurred.

- The games list asks the themed engine for `icons/lock` directly, so the
  item view paints it at the device pixel ratio and the lock also follows
  HighlightedText on a selected row.
- The dropdown goes through `loadThemedIcon(...).pixmap(size, dpr)`, which
  keeps the glyph's aspect ratio and renders at the requested ratio.
- LockPixmapGenerator has no consumer left, so it and its cache are gone.

---------

Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
2026-11-04 18:39:41 +01:00
..
card_completer_delegate.cpp [Fonts] Migrate CardText surfaces to theme font role (#7538) 2026-11-04 07:57:54 +01:00
card_completer_delegate.h [Completer] Minimum size popup, fall back to compact design if not possible. (#7111) 2026-10-15 18:10:07 +02:00
card_completer_styler.cpp [Fonts] Restore DeckList Serif default and live-update all role readers (#7541) 2026-11-04 07:57:55 +01:00
card_completer_styler.h [Completer] Highlight popup rows without rewriting the line edit (#7502) 2026-10-16 19:01:38 +02:00
compact_push_button.cpp [Tooling] Apply include-what-you-use across the tree (#7396) 2026-10-08 11:13:50 +02:00
compact_push_button.h [Tooling] Apply include-what-you-use across the tree (#7396) 2026-10-08 11:13:50 +02:00
completer_utils.cpp [UI] Fix auto-completion acceptance on Space/Tab/Enter (#7466) 2026-10-10 09:45:42 +02:00
completer_utils.h [CardSearch] Add card completion popups to chats and search fields (#7089) 2026-08-11 18:50:30 +02:00
custom_line_edit.cpp [Tooling] Apply include-what-you-use across the tree (#7396) 2026-10-08 11:13:50 +02:00
custom_line_edit.h [Tooling] Apply include-what-you-use across the tree (#7396) 2026-10-08 11:13:50 +02:00
get_text_with_max.cpp [Tooling] Apply include-what-you-use across the tree (#7396) 2026-10-08 11:13:50 +02:00
get_text_with_max.h [Tooling] Apply include-what-you-use across the tree (#7396) 2026-10-08 11:13:50 +02:00
line_edit_completer.cpp [Chat] Fix card completion after an @ mention (#7469) 2026-10-11 15:35:10 +02:00
line_edit_completer.h [Tooling] Apply include-what-you-use across the tree (#7396) 2026-10-08 11:13:50 +02:00
report_utils.cpp [Fonts] Migrate ChatLog surfaces to theme font role (#7537) 2026-11-04 07:57:53 +01:00
report_utils.h [Fonts] Migrate ChatLog surfaces to theme font role (#7537) 2026-11-04 07:57:53 +01:00
reversed_completer_model.cpp [Tooling] Apply include-what-you-use across the tree (#7396) 2026-10-08 11:13:50 +02:00
reversed_completer_model.h [Tooling] Apply include-what-you-use across the tree (#7396) 2026-10-08 11:13:50 +02:00
sequence_edit.cpp [Icons] Migrate UI glyphs to palette-token SVGs (#7595) 2026-11-04 18:39:41 +01:00
sequence_edit.h [Tooling] Apply include-what-you-use across the tree (#7396) 2026-10-08 11:13:50 +02:00
visibility_change_listener.cpp [TabDeckEditor] Generalize visibility filter and extract it to a separate file (#6526) 2026-01-16 10:12:46 -05:00
visibility_change_listener.h [Tooling] Apply include-what-you-use across the tree (#7396) 2026-10-08 11:13:50 +02:00