Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Utilities
KBackup
Commits
ae5b9e5a
Commit
ae5b9e5a
authored
Apr 25, 2021
by
Nicolas Fella
Browse files
Fix rendering of icon overlays on HighDPI
Use KIconUtils instead of KIconLoader API. The former does HighDPI correctly.
parent
c21add02
Changes
4
Hide whitespace changes
Inline
Side-by-side
CMakeLists.txt
View file @
ae5b9e5a
...
...
@@ -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
...
...
src/CMakeLists.txt
View file @
ae5b9e5a
...
...
@@ -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
...
...
src/MainWidget.cxx
View file @
ae5b9e5a
...
...
@@ -11,7 +11,6 @@
#include <Archiver.hxx>
#include <Selector.hxx>
#include <KIconLoader>
#include <KUrlCompletion>
#include <QPushButton>
...
...
src/Selector.cxx
View file @
ae5b9e5a
...
...
@@ -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
=
KIcon
Loader
::
global
()
->
loadIcon
(
QStringLiteral
(
"folder"
),
KIconLoader
::
Small
,
0
,
KIconLoader
::
DefaultState
,
QStringList
(
QStringLiteral
(
"emblem-symbolic-link"
))
);
folderLinkIcon
=
KIcon
Utils
::
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
=
KIcon
Loader
::
global
()
->
loadIcon
(
QStringLiteral
(
"text-x-generic"
),
KIconLoader
::
Small
,
0
,
KIconLoader
::
DefaultState
,
QStringList
(
QStringLiteral
(
"emblem-symbolic-link"
))
);
documentLinkIcon
=
KIcon
Utils
::
addOverlay
(
documentIcon
,
QIcon
::
fromTheme
(
QStringLiteral
(
"emblem-symbolic-link"
))
,
Qt
::
BottomRightCorner
).
pixmap
(
KIconLoader
::
SizeSmall
);
documentLinkIconHidden
=
effect
.
apply
(
documentLinkIcon
,
KIconEffect
::
DeSaturate
,
0
,
QColor
(),
true
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment