From 9eac47dc6c769fca50d35bc5a4469490eb488bbf Mon Sep 17 00:00:00 2001 From: TheLastRar Date: Sat, 31 May 2025 16:42:42 +0100 Subject: [PATCH] Qt: Fix selected gamelist icons being wrong colour after theme switch --- pcsx2-qt/GameList/GameListWidget.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/pcsx2-qt/GameList/GameListWidget.cpp b/pcsx2-qt/GameList/GameListWidget.cpp index be2e9116cd..5c95a585f2 100644 --- a/pcsx2-qt/GameList/GameListWidget.cpp +++ b/pcsx2-qt/GameList/GameListWidget.cpp @@ -138,16 +138,15 @@ namespace if (option.state & QStyle::State_Selected) { // See QItemDelegate::selectedPixmap() - QString key = QString::fromStdString(fmt::format("{:016X}-{:d}", pix.cacheKey(), enabled)); + QColor color = option.palette.color(enabled ? QPalette::Normal : QPalette::Disabled, QPalette::Highlight); + color.setAlphaF(0.3f); + + QString key = QString::fromStdString(fmt::format("{:016X}-{:d}-{:08X}", pix.cacheKey(), enabled, color.rgba())); QPixmap pm; if (!QPixmapCache::find(key, &pm)) { QImage img = pix.toImage().convertToFormat(QImage::Format_ARGB32_Premultiplied); - QColor color = option.palette.color(enabled ? QPalette::Normal : QPalette::Disabled, - QPalette::Highlight); - color.setAlphaF(0.3f); - QPainter tinted_painter(&img); tinted_painter.setCompositionMode(QPainter::CompositionMode_SourceAtop); tinted_painter.fillRect(0, 0, img.width(), img.height(), color);