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
Multimedia
Kdenlive
Commits
460910bc
Commit
460910bc
authored
Jun 06, 2022
by
Julius Künzel
Browse files
Fix icon color change in some situations (eg. Appimage)
BUG: 450556
(cherry picked from commit
4ca161d5
)
parent
056d1462
Pipeline
#187879
skipped
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
src/main.cpp
View file @
460910bc
...
...
@@ -181,16 +181,16 @@ int main(int argc, char *argv[])
KConfigGroup
grp
(
config
,
"unmanaged"
);
if
(
!
grp
.
exists
())
{
QProcessEnvironment
env
=
QProcessEnvironment
::
systemEnvironment
();
if
(
env
.
contains
(
QStringLiteral
(
"XDG_CURRENT_DESKTOP"
))
&&
env
.
value
(
QStringLiteral
(
"XDG_CURRENT_DESKTOP"
)).
toLower
()
==
QLatin1String
(
"kde"
))
{
qCDebug
(
KDENLIVE_LOG
)
<<
"KDE Desktop detected, using system icons"
;
if
(
env
.
value
(
QStringLiteral
(
"XDG_CURRENT_DESKTOP"
)).
toLower
()
==
QLatin1String
(
"kde"
)
&&
packageType
!=
QStringLiteral
(
"appimage"
)
)
{
qCDebug
(
KDENLIVE_LOG
)
<<
"KDE Desktop detected
and not Appimage
, using system icons"
;
}
else
{
// We are not on a KDE desktop, force breeze icon theme
// We are not on a KDE desktop
or in an Appimage
, force breeze icon theme
// Check if breeze theme is available
QStringList
iconThemes
=
KIconTheme
::
list
();
if
(
iconThemes
.
contains
(
QStringLiteral
(
"breeze"
)))
{
grp
.
writeEntry
(
"force_breeze"
,
true
);
grp
.
writeEntry
(
"use_dark_breeze"
,
true
);
qCDebug
(
KDENLIVE_LOG
)
<<
"Non KDE Desktop detected, forcing Breeze icon theme"
;
qCDebug
(
KDENLIVE_LOG
)
<<
"Non KDE Desktop
or Appimage
detected, forcing Breeze icon theme"
;
}
}
}
...
...
src/mainwindow.cpp
View file @
460910bc
...
...
@@ -893,8 +893,14 @@ void MainWindow::slotThemeChanged(const QString &name)
KSharedConfigPtr
kconfig
=
KSharedConfig
::
openConfig
();
KConfigGroup
initialGroup
(
kconfig
,
"version"
);
if
(
initialGroup
.
exists
()
&&
KdenliveSettings
::
force_breeze
()
&&
useDarkIcons
!=
KdenliveSettings
::
use_dark_breeze
())
{
// We need to reload icon theme
QProcessEnvironment
env
=
QProcessEnvironment
::
systemEnvironment
();
bool
isAppimage
=
pCore
->
packageType
()
==
QStringLiteral
(
"appimage"
);
bool
isKDE
=
env
.
value
(
QStringLiteral
(
"XDG_CURRENT_DESKTOP"
)).
toLower
()
==
QLatin1String
(
"kde"
);
bool
forceBreeze
=
initialGroup
.
exists
()
&&
KdenliveSettings
::
force_breeze
();
if
((
!
isKDE
||
isAppimage
||
forceBreeze
)
&&
((
useDarkIcons
&&
QIcon
::
themeName
()
==
QStringLiteral
(
"breeze"
))
||
(
!
useDarkIcons
&&
QIcon
::
themeName
()
==
QStringLiteral
(
"breeze-dark"
))))
{
// We need to reload icon theme, on KDE desktops this is not necessary, however for the Appimage it is even on KDE Desktop
// See also https://kate-editor.org/post/2021/2021-03-07-cross-platform-light-dark-themes-and-icons/
QIcon
::
setThemeName
(
useDarkIcons
?
QStringLiteral
(
"breeze-dark"
)
:
QStringLiteral
(
"breeze"
));
KdenliveSettings
::
setUse_dark_breeze
(
useDarkIcons
);
}
...
...
Write
Preview
Supports
Markdown
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