┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/panels/information
diff options
context:
space:
mode:
Diffstat (limited to 'src/panels/information')
-rw-r--r--src/panels/information/informationpanelcontent.cpp16
-rw-r--r--src/panels/information/informationpanelcontent.h1
2 files changed, 15 insertions, 2 deletions
diff --git a/src/panels/information/informationpanelcontent.cpp b/src/panels/information/informationpanelcontent.cpp
index db7117e5a..afca9a76c 100644
--- a/src/panels/information/informationpanelcontent.cpp
+++ b/src/panels/information/informationpanelcontent.cpp
@@ -172,6 +172,9 @@ void InformationPanelContent::refreshPixmapView()
m_previewJob->kill();
}
+ // Reset disabled state when starting a new preview job
+ m_disabledPreviewUrl.clear();
+
// try to get a preview pixmap from the item...
// Mark the currently shown preview as outdated. This is done
@@ -362,6 +365,7 @@ void InformationPanelContent::showIcon(const KFileItem &item)
QPixmap pixmap = KIconUtils::addOverlays(icon, item.overlays()).pixmap(m_preview->size(), devicePixelRatioF());
pixmap.setDevicePixelRatio(devicePixelRatioF());
m_preview->setPixmap(pixmap);
+ m_disabledPreviewUrl.clear();
}
void InformationPanelContent::showPreview(const KFileItem &item, const QPixmap &pixmap)
@@ -434,9 +438,17 @@ void InformationPanelContent::markOutdatedPreview()
// use it until the preview is done
showIcon(m_item);
} else {
+ // Only apply disabled effect once per URL to avoid repeated brightening
+ if (m_disabledPreviewUrl == m_item.url()) {
+ return;
+ }
+ m_disabledPreviewUrl = m_item.url();
+
QPixmap disabledPixmap = m_preview->pixmap();
- KIconEffect::toDisabled(disabledPixmap);
- m_preview->setPixmap(disabledPixmap);
+ if (!disabledPixmap.isNull()) {
+ KIconEffect::toDisabled(disabledPixmap);
+ m_preview->setPixmap(disabledPixmap);
+ }
}
}
diff --git a/src/panels/information/informationpanelcontent.h b/src/panels/information/informationpanelcontent.h
index 58adfb9c0..e305eddde 100644
--- a/src/panels/information/informationpanelcontent.h
+++ b/src/panels/information/informationpanelcontent.h
@@ -154,6 +154,7 @@ private:
QDialogButtonBox *m_configureButtons;
bool m_isVideo;
+ QUrl m_disabledPreviewUrl;
};
#endif // INFORMATIONPANELCONTENT_H