From 67a212d67705dd3c46ad3e3743b652274e6e7795 Mon Sep 17 00:00:00 2001 From: BruebachL <44814898+BruebachL@users.noreply.github.com> Date: Sat, 24 Oct 2026 10:40:20 +0200 Subject: [PATCH] [Theme] Drop stale pixmap caches on palette-only preview (#7600) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A palette preview repaints widgets through applyStyleAndPalette without running themeChangedSlot, so generator-owned pixmaps stayed at the previous palette until the next full theme switch. Clear them where the palette is applied. Co-authored-by: Lukas BrĂ¼bach --- cockatrice/src/interface/theme_manager.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cockatrice/src/interface/theme_manager.cpp b/cockatrice/src/interface/theme_manager.cpp index 9a96b3e45..893cdc795 100644 --- a/cockatrice/src/interface/theme_manager.cpp +++ b/cockatrice/src/interface/theme_manager.cpp @@ -558,6 +558,9 @@ void ThemeManager::applyStyleAndPalette(const QString &themeName, widget->update(); } + // Palette-only previews do not run themeChangedSlot(), so drop snapshots + // generated under the previous palette here as well. + clearPixmapGeneratorCaches(); emit paletteChanged(); }