Cockatrice/cockatrice
Lukas Brübach 95e5cda296 [Icons] Add palette-aware themed icon engine
A QPixmap snapshot cannot follow palette changes, so expose a QIcon whose
engine resolves the `currentColor` sentinel from the live palette on every
pixmap request. Icons stay legible across light/dark switches without
recreating actions or buttons.

- Resolve the asset, its bytes and its intrinsic size once, and drop them on
  ThemeManager::themeChanged/paletteChanged. A repaint does no file I/O and
  no theme.cfg parse; the palette color stays part of the render cache key.
- Centre the glyph on QRectF(rect).center(): QRect::center() floors and uses
  right = left + width - 1, which shifted every 16x16 item-view glyph up and
  left by a logical pixel and clipped its last row and column.
- Take a raster override's intrinsic size from QImageReader instead of the
  24x24 SVG default, so a non-square override reports the box it draws.
- Set the device pixel ratio before inserting into the render cache, so a
  cache hit no longer detaches the pixmap on every paint.
2026-11-02 11:35:14 +01:00
..
resources [Themes] Encode home backgrounds as JPEG to slim the repo (#7346) 2026-09-24 18:40:04 +02:00
sounds Add cmake format (#4618) 2022-05-08 21:22:43 +02:00
src [Icons] Add palette-aware themed icon engine 2026-11-02 11:35:14 +01:00
themes [Themes] Encode home backgrounds as JPEG to slim the repo (#7346) 2026-09-24 18:40:04 +02:00
translations Updates for project Cockatrice and language ru (#7561) 2026-10-17 16:43:14 +02:00
.qdevelop icon_draw and icon_untap added, icon_general and icon_messages modified 2009-07-31 13:37:16 +02:00
CMakeLists.txt [Icons] Add palette-aware themed icon engine 2026-11-02 11:35:14 +01:00
cockatrice-cod.xml Define Cockatrice as an editor/handler for .cod files and cockatrice:// protocol on all platforms (#6775) 2026-08-08 19:02:19 +02:00
cockatrice.desktop fix the desktop file, removing the invalid key (#7406) 2026-10-10 17:15:10 +02:00
cockatrice.qrc [Themes] Encode home backgrounds as JPEG to slim the repo (#7346) 2026-09-24 18:40:04 +02:00
cockatrice.rc Included uninstaller for Windows version 2010-09-17 15:26:07 +02:00
cockatrice_en@source.ts Update translation source strings (#7397) 2026-10-04 21:08:47 +02:00