Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Plasma
Plasma Workspace
Commits
d046d4e5
Verified
Commit
d046d4e5
authored
Sep 20, 2022
by
Fushan Wen
Browse files
wallpapers/image: open dark image in dark mode
(cherry picked from commit
e6f5bb30
)
parent
6e8d1343
Changes
1
Hide whitespace changes
Inline
Side-by-side
wallpapers/image/plugin/model/packagelistmodel.cpp
View file @
d046d4e5
...
...
@@ -8,6 +8,8 @@
#include
"packagelistmodel.h"
#include
<QDir>
#include
<QGuiApplication>
#include
<QPalette>
#include
<QPixmap>
#include
<QStandardPaths>
#include
<QThreadPool>
...
...
@@ -86,8 +88,16 @@ QVariant PackageListModel::data(const QModelIndex &index, int role) const
return
QString
();
}
case
PathRole
:
case
PathRole
:
{
if
(
qGray
(
qGuiApp
->
palette
().
window
().
color
().
rgb
())
<
192
)
{
const
QString
darkPath
=
b
.
filePath
(
QByteArrayLiteral
(
"preferredDark"
));
if
(
!
darkPath
.
isEmpty
())
{
return
QUrl
::
fromLocalFile
(
darkPath
);
}
}
return
QUrl
::
fromLocalFile
(
b
.
filePath
(
"preferred"
));
}
case
PackageNameRole
:
return
b
.
path
();
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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