parent
79ba066c6c
commit
4821b6499c
@ -1,60 +0,0 @@
|
|||||||
From c2efa3e48e8de13e4fd5d35bd1a3ae961b8ec9c7 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Jan Grulich <jgrulich@redhat.com>
|
|
||||||
Date: Mon, 15 May 2023 13:11:58 +0200
|
|
||||||
Subject: [PATCH] KIconTheme: allow to also fallback to Breeze-dark when set
|
|
||||||
through QPA
|
|
||||||
|
|
||||||
KIconTheme always fallbacks to Breeze icon theme in order to make sure
|
|
||||||
KDE apps are not missing icons on other desktops, like GNOME. Problem is
|
|
||||||
that we always fallback to the light variant of Breeze, which will have
|
|
||||||
icons that are barely visible when applications are using dark theme.
|
|
||||||
This change checks fallback icon theme set through QPlatformTheme, like
|
|
||||||
QGnomePlatform which can fallback to correct Breeze variant depending on
|
|
||||||
the used system theme.
|
|
||||||
---
|
|
||||||
src/kicontheme.cpp | 17 ++++++++++++++++-
|
|
||||||
1 file changed, 16 insertions(+), 1 deletion(-)
|
|
||||||
|
|
||||||
diff --git a/src/kicontheme.cpp b/src/kicontheme.cpp
|
|
||||||
index bf3e2b64..c05094b8 100644
|
|
||||||
--- a/src/kicontheme.cpp
|
|
||||||
+++ b/src/kicontheme.cpp
|
|
||||||
@@ -26,6 +26,9 @@
|
|
||||||
#include <QResource>
|
|
||||||
#include <QSet>
|
|
||||||
|
|
||||||
+#include <private/qguiapplication_p.h>
|
|
||||||
+#include <qpa/qplatformtheme.h>
|
|
||||||
+
|
|
||||||
#include <qplatformdefs.h>
|
|
||||||
|
|
||||||
#include <array>
|
|
||||||
@@ -60,13 +63,25 @@ void initRCCIconTheme()
|
|
||||||
}
|
|
||||||
Q_COREAPP_STARTUP_FUNCTION(initRCCIconTheme)
|
|
||||||
|
|
||||||
-// Set the icon theme fallback to breeze
|
|
||||||
+// Set the icon theme fallback to breeze and/or to breeze-dark
|
|
||||||
+// in case it has been set as system fallback icon theme.
|
|
||||||
// Most of our apps use "lots" of icons that most of the times
|
|
||||||
// are only available with breeze, we still honour the user icon
|
|
||||||
// theme but if the icon is not found there, we go to breeze
|
|
||||||
// since it's almost sure it'll be there
|
|
||||||
static void setBreezeFallback()
|
|
||||||
{
|
|
||||||
+ if (const QPlatformTheme *theme = QGuiApplicationPrivate::platformTheme()) {
|
|
||||||
+ const QVariant themeHint = theme->themeHint(QPlatformTheme::SystemIconFallbackThemeName);
|
|
||||||
+ if (themeHint.isValid()) {
|
|
||||||
+ const QString theme = themeHint.toString();
|
|
||||||
+ if (theme.toLower().contains("breeze")) {
|
|
||||||
+ QIcon::setFallbackThemeName(theme);
|
|
||||||
+ return;
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
QIcon::setFallbackThemeName(QStringLiteral("breeze"));
|
|
||||||
}
|
|
||||||
|
|
||||||
--
|
|
||||||
GitLab
|
|
@ -1 +1 @@
|
|||||||
SHA512 (kiconthemes-5.106.0.tar.xz) = efcb0983af25d0fe0488f69ab2152a79ece0fd5f4643381770a95b4297b159a4606deab4c8ead7dd8a5f9f5805b5f116853e24f1d7295dd7eca9e292fe1a150d
|
SHA512 (kiconthemes-5.107.0.tar.xz) = f7d030a701ea47def5ddbda4f41570940e5e03a21e27dd16cc8e2a046b76bc82ed65cd700e97f35e3ba1788fe003a57f65808c6285969dd244fd80c05b543083
|
||||||
|
Loading…
Reference in new issue