diff options
| author | Nicolas Fella <[email protected]> | 2024-07-17 00:03:52 +0200 |
|---|---|---|
| committer | Nicolas Fella <[email protected]> | 2024-07-18 23:15:45 +0000 |
| commit | 38ab14c87a945153e683657483fa4bcf44d6b0fb (patch) | |
| tree | 876e7606ce0086bb4c782b7fe4b9b0e3598747d6 /src/panels | |
| parent | 43269bc9283a3f52fa08f5dbefee728b673f58ce (diff) | |
Port away from deprecated KIconEffect API
Diffstat (limited to 'src/panels')
| -rw-r--r-- | src/panels/information/informationpanelcontent.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/panels/information/informationpanelcontent.cpp b/src/panels/information/informationpanelcontent.cpp index 86a569a86..70d85a402 100644 --- a/src/panels/information/informationpanelcontent.cpp +++ b/src/panels/information/informationpanelcontent.cpp @@ -411,8 +411,15 @@ void InformationPanelContent::markOutdatedPreview() // use it until the preview is done showIcon(m_item); } else { - KIconEffect *iconEffect = KIconLoader::global()->iconEffect(); - QPixmap disabledPixmap = iconEffect->apply(m_preview->pixmap(), KIconLoader::Desktop, KIconLoader::DisabledState); +#if KICONTHEMES_VERSION >= QT_VERSION_CHECK(6, 5, 0) + QPixmap disabledPixmap = m_preview->pixmap(); + KIconEffect::toDisabled(disabledPixmap); +#else + QImage img = m_preview->pixmap().toImage(); + KIconEffect::toGray(img, 1); + KIconEffect::semiTransparent(img); + QPixmap disabledPixmap = QPixmap::fromImage(img); +#endif m_preview->setPixmap(disabledPixmap); } } |
