Commit ae5b9e5a authored by Nicolas Fella's avatar Nicolas Fella
Browse files

Fix rendering of icon overlays on HighDPI

Use KIconUtils instead of KIconLoader API. The former does HighDPI
correctly.
parent c21add02
......@@ -29,6 +29,7 @@ find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS
)
find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS
GuiAddons
Notifications
I18n
KIO
......
......@@ -15,6 +15,7 @@ add_executable(kbackup ${kbackup_SRCS})
target_link_libraries(kbackup
Qt::Core
Qt::Widgets
KF5::GuiAddons
KF5::I18n
KF5::KIOCore
KF5::KIOFileWidgets
......
......@@ -11,7 +11,6 @@
#include <Archiver.hxx>
#include <Selector.hxx>
#include <KIconLoader>
#include <KUrlCompletion>
#include <QPushButton>
......
......@@ -13,6 +13,7 @@
#include <kio/global.h>
#include <KIconLoader>
#include <KIconEffect>
#include <KIconUtils>
#include <KLocalizedString>
#include <KPropertiesDialog>
#include <KFileItem>
......@@ -369,9 +370,9 @@ void Selector::fillTree(ListItem *parent, const QString &path, bool on)
folderIcon = QIcon::fromTheme(QStringLiteral("folder")).pixmap(KIconLoader::SizeSmall);
folderIconHidden = effect.apply(folderIcon, KIconEffect::DeSaturate, 0, QColor(), true);
folderLinkIcon = KIconLoader::global()->loadIcon(QStringLiteral("folder"), KIconLoader::Small,
0, KIconLoader::DefaultState,
QStringList(QStringLiteral("emblem-symbolic-link")));
folderLinkIcon = KIconUtils::addOverlay(folderIcon,
QIcon::fromTheme(QStringLiteral("emblem-symbolic-link")),
Qt::BottomRightCorner).pixmap(KIconLoader::SizeSmall);
folderLinkIconHidden = effect.apply(folderLinkIcon, KIconEffect::DeSaturate, 0, QColor(), true);
}
......@@ -394,9 +395,9 @@ void Selector::fillTree(ListItem *parent, const QString &path, bool on)
documentIcon = QIcon::fromTheme(QStringLiteral("text-x-generic")).pixmap(KIconLoader::SizeSmall);
documentIconHidden = effect.apply(documentIcon, KIconEffect::DeSaturate, 0, QColor(), true);
documentLinkIcon = KIconLoader::global()->loadIcon(QStringLiteral("text-x-generic"), KIconLoader::Small,
0, KIconLoader::DefaultState,
QStringList(QStringLiteral("emblem-symbolic-link")));
documentLinkIcon = KIconUtils::addOverlay(documentIcon,
QIcon::fromTheme(QStringLiteral("emblem-symbolic-link")),
Qt::BottomRightCorner).pixmap(KIconLoader::SizeSmall);
documentLinkIconHidden = effect.apply(documentLinkIcon, KIconEffect::DeSaturate, 0, QColor(), true);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment