Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Multimedia
Kdenlive
Commits
d1495235
Commit
d1495235
authored
May 25, 2019
by
Vincent Pinon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix windows icons
parent
17e6272a
Pipeline
#3782
passed with stage
in 14 minutes and 16 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
3 deletions
+22
-3
src/main.cpp
src/main.cpp
+20
-0
src/mainwindow.cpp
src/mainwindow.cpp
+2
-3
No files found.
src/main.cpp
View file @
d1495235
...
...
@@ -42,6 +42,7 @@
#include "kdenlive_debug.h"
#include <KDBusService>
#include <KIconTheme>
#include <QResource>
#include <QApplication>
#include <QCommandLineOption>
#include <QCommandLineParser>
...
...
@@ -98,6 +99,25 @@ int main(int argc, char *argv[])
KConfigGroup
cg
(
config
,
"UiSettings"
);
cg
.
writeEntry
(
"ColorScheme"
,
"Breeze Dark"
);
}
#ifdef Q_OS_WIN
const
QStringList
themes
{
"/icons/breeze/breeze-icons.rcc"
,
"/icons/breeze-dark/breeze-icons-dark.rcc"
};
for
(
const
QString
theme
:
themes
)
{
const
QString
themePath
=
QStandardPaths
::
locate
(
QStandardPaths
::
AppDataLocation
,
theme
);
if
(
!
themePath
.
isEmpty
())
{
const
QString
iconSubdir
=
theme
.
left
(
theme
.
lastIndexOf
(
'/'
));
if
(
QResource
::
registerResource
(
themePath
,
iconSubdir
))
{
if
(
QFileInfo
::
exists
(
QLatin1Char
(
':'
)
+
iconSubdir
+
QStringLiteral
(
"/index.theme"
)))
{
qDebug
()
<<
"Loaded icon theme:"
<<
theme
;
}
else
{
qWarning
()
<<
"No index.theme found in"
<<
theme
;
QResource
::
unregisterResource
(
themePath
,
iconSubdir
);
}
}
else
{
qWarning
()
<<
"Invalid rcc file"
<<
theme
;
}
}
}
#endif
// Init DBus services
KDBusService
programDBusService
;
...
...
src/mainwindow.cpp
View file @
d1495235
...
...
@@ -640,11 +640,10 @@ void MainWindow::slotThemeChanged(const QString &name)
KdenliveSettings
::
setUse_dark_breeze
(
useDarkIcons
);
}
#if KXMLGUI_VERSION
_MINOR < 23 && KXMLGUI_VERSION_MAJOR == 5
#if
(
KXMLGUI_VERSION
< QT_VERSION_CHECK(5, 23, 0)) || defined(Q_OS_WIN)
// Not required anymore with auto colored icons since KF5 5.23
QColor
background
=
plt
.
window
().
color
();
bool
useDarkIcons
=
background
.
value
()
<
100
;
if
(
m_themeInitialized
&&
useDarkIcons
!=
m_isDarkTheme
)
{
QIcon
::
setThemeName
(
useDarkIcons
?
QStringLiteral
(
"breeze-dark"
)
:
QStringLiteral
(
"breeze"
));
if
(
pCore
->
bin
())
{
pCore
->
bin
()
->
refreshIcons
();
}
...
...
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