mirror of
https://invent.kde.org/system/dolphin
synced 2024-10-28 03:21:56 +00:00
[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
This commit is contained in:
parent
200e0d1f07
commit
502a5c86fe
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue