From: Kai Uwe Broulik Date: Wed, 24 Oct 2018 07:52:36 +0000 (+0200) Subject: [KStandardItemListWidget] Pass icon state to overlay painter X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/commitdiff_plain/502a5c86feb0015c42f052d242c8115de320a38e [KStandardItemListWidget] Pass icon state to overlay painter Ensures the overlay is painted in the same icon state, especially the selected one so dark overlays turn white. Differential Revision: https://phabricator.kde.org/D16307 --- diff --git a/src/kitemviews/kstandarditemlistwidget.cpp b/src/kitemviews/kstandarditemlistwidget.cpp index 8d943ae16..f56f68ac5 100644 --- a/src/kitemviews/kstandarditemlistwidget.cpp +++ b/src/kitemviews/kstandarditemlistwidget.cpp @@ -1500,9 +1500,25 @@ QPixmap KStandardItemListWidget::pixmapForIcon(const QString& name, const QStrin // setup time. foreach (const QString& overlay, overlays) { if (!overlay.isEmpty()) { + int state = KIconLoader::DefaultState; + + switch (mode) { + case QIcon::Normal: + break; + case QIcon::Active: + state = KIconLoader::ActiveState; + break; + case QIcon::Disabled: + state = KIconLoader::DisabledState; + break; + case QIcon::Selected: + state = KIconLoader::SelectedState; + break; + } + // There is at least one overlay, draw all overlays above m_pixmap // and cancel the check - KIconLoader::global()->drawOverlays(overlays, pixmap, KIconLoader::Desktop); + KIconLoader::global()->drawOverlays(overlays, pixmap, KIconLoader::Desktop, state); break; } }