This commit is contained in:
Jan Grulich 2023-05-11 09:26:29 +02:00
parent e1fe32bba5
commit 5a953d258a
7 changed files with 9 additions and 773 deletions

1
.gitignore vendored
View File

@ -15,3 +15,4 @@
/QGnomePlatform-0.8.3.tar.gz
/QGnomePlatform-0.8.4.tar.gz
/QGnomePlatform-0.9.0.tar.gz
/QGnomePlatform-0.9.1.tar.gz

View File

@ -1,629 +0,0 @@
From d9c0210ac45f7de71750655a3ca0d89581d19f88 Mon Sep 17 00:00:00 2001
From: Jan Grulich <jgrulich@redhat.com>
Date: Fri, 10 Mar 2023 11:04:41 +0100
Subject: [PATCH] Add support for KColorScheme using Adwaita-like color schemes
---
src/CMakeLists.txt | 1 +
src/color-schemes/Adwaita.colors | 120 ++++++++++++++
src/color-schemes/AdwaitaDark.colors | 147 ++++++++++++++++++
src/color-schemes/AdwaitaHighcontrast.colors | 120 ++++++++++++++
.../AdwaitaHighcontrastInverse.colors | 147 ++++++++++++++++++
src/color-schemes/CMakeLists.txt | 4 +
src/common/gnomesettings.cpp | 14 ++
7 files changed, 553 insertions(+)
create mode 100644 src/color-schemes/Adwaita.colors
create mode 100644 src/color-schemes/AdwaitaDark.colors
create mode 100644 src/color-schemes/AdwaitaHighcontrast.colors
create mode 100644 src/color-schemes/AdwaitaHighcontrastInverse.colors
create mode 100644 src/color-schemes/CMakeLists.txt
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 1823d54..1241d6b 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -1,3 +1,4 @@
+add_subdirectory(color-schemes)
add_subdirectory(common)
if (NOT DISABLE_DECORATION_SUPPORT)
diff --git a/src/color-schemes/Adwaita.colors b/src/color-schemes/Adwaita.colors
new file mode 100644
index 0000000..2161672
--- /dev/null
+++ b/src/color-schemes/Adwaita.colors
@@ -0,0 +1,120 @@
+[ColorEffects:Disabled]
+Color=56,56,56
+ColorAmount=0
+ColorEffect=0
+ContrastAmount=0.65
+ContrastEffect=1
+IntensityAmount=0.1
+IntensityEffect=2
+
+[ColorEffects:Inactive]
+ChangeSelectionColor=true
+Color=112,111,110
+ColorAmount=0.025
+ColorEffect=2
+ContrastAmount=0.1
+ContrastEffect=2
+Enable=false
+IntensityAmount=0
+IntensityEffect=0
+
+[Colors:Button]
+BackgroundAlternate=241,239,238
+BackgroundNormal=241,239,238
+DecorationFocus=61,174,233
+DecorationHover=147,206,233
+ForegroundActive=61,174,233
+ForegroundInactive=127,140,141
+ForegroundLink=41,128,185
+ForegroundNegative=218,68,83
+ForegroundNeutral=198,92,0
+ForegroundNormal=55,61,63
+ForegroundPositive=39,174,96
+ForegroundVisited=127,140,141
+
+[Colors:Complementary]
+BackgroundAlternate=59,64,69
+BackgroundNormal=49,54,59
+DecorationFocus=30,146,255
+DecorationHover=61,174,230
+ForegroundActive=147,206,233
+ForegroundInactive=175,176,179
+ForegroundLink=61,174,230
+ForegroundNegative=231,76,60
+ForegroundNeutral=253,188,75
+ForegroundNormal=239,240,241
+ForegroundPositive=46,204,113
+ForegroundVisited=61,174,230
+
+[Colors:Selection]
+BackgroundAlternate=53,132,228
+BackgroundNormal=53,132,228
+DecorationFocus=61,174,233
+DecorationHover=147,206,233
+ForegroundActive=252,252,252
+ForegroundInactive=239,240,241
+ForegroundLink=253,188,75
+ForegroundNegative=176,55,69
+ForegroundNeutral=246,116,0
+ForegroundNormal=252,253,255
+ForegroundPositive=23,104,57
+ForegroundVisited=189,195,199
+
+[Colors:Tooltip]
+BackgroundAlternate=0,0,0
+BackgroundNormal=0,0,0
+DecorationFocus=61,174,233
+DecorationHover=147,206,233
+ForegroundActive=61,174,233
+ForegroundInactive=189,195,199
+ForegroundLink=41,128,185
+ForegroundNegative=218,68,83
+ForegroundNeutral=246,116,0
+ForegroundNormal=255,255,255
+ForegroundPositive=39,174,96
+ForegroundVisited=127,140,141
+
+[Colors:View]
+BackgroundAlternate=255,255,255
+BackgroundNormal=255,255,255
+DecorationFocus=61,174,233
+DecorationHover=147,206,233
+ForegroundActive=61,174,233
+ForegroundInactive=25,25,25
+ForegroundLink=41,128,185
+ForegroundNegative=218,68,83
+ForegroundNeutral=246,116,0
+ForegroundNormal=25,25,25
+ForegroundPositive=39,174,96
+ForegroundVisited=127,140,141
+
+[Colors:Window]
+BackgroundAlternate=246,245,244
+BackgroundNormal=246,245,244
+DecorationFocus=61,174,233
+DecorationHover=147,206,233
+ForegroundActive=61,174,233
+ForegroundInactive=127,140,141
+ForegroundLink=41,128,185
+ForegroundNegative=218,68,83
+ForegroundNeutral=246,116,0
+ForegroundNormal=54,59,61
+ForegroundPositive=39,174,96
+ForegroundVisited=127,140,141
+
+[General]
+ColorScheme=BreezeClassic
+Name=Adwaita
+TitlebarIsAccentColored=true
+shadeSortColumn=true
+
+[KDE]
+contrast=4
+
+[WM]
+activeBackground=222,219,215
+activeBlend=252,252,252
+activeForeground=54,59,61
+inactiveBackground=239,240,241
+inactiveBlend=75,71,67
+inactiveForeground=189,195,199
diff --git a/src/color-schemes/AdwaitaDark.colors b/src/color-schemes/AdwaitaDark.colors
new file mode 100644
index 0000000..bc92512
--- /dev/null
+++ b/src/color-schemes/AdwaitaDark.colors
@@ -0,0 +1,147 @@
+[ColorEffects:Disabled]
+Color=56,56,56
+ColorAmount=0
+ColorEffect=0
+ContrastAmount=0.65
+ContrastEffect=1
+IntensityAmount=0.1
+IntensityEffect=2
+
+[ColorEffects:Inactive]
+ChangeSelectionColor=true
+Color=112,111,110
+ColorAmount=0.025
+ColorEffect=2
+ContrastAmount=0.1
+ContrastEffect=2
+Enable=false
+IntensityAmount=0
+IntensityEffect=0
+
+[Colors:Button]
+BackgroundAlternate=52,52,52
+BackgroundNormal=52,52,52
+DecorationFocus=61,174,233
+DecorationHover=61,174,233
+ForegroundActive=61,174,233
+ForegroundInactive=161,169,177
+ForegroundLink=29,153,243
+ForegroundNegative=218,68,83
+ForegroundNeutral=246,116,0
+ForegroundNormal=238,238,236
+ForegroundPositive=39,174,96
+ForegroundVisited=155,89,182
+
+[Colors:Complementary]
+BackgroundAlternate=30,87,116
+BackgroundNormal=42,46,50
+DecorationFocus=61,174,233
+DecorationHover=61,174,233
+ForegroundActive=61,174,233
+ForegroundInactive=161,169,177
+ForegroundLink=29,153,243
+ForegroundNegative=218,68,83
+ForegroundNeutral=246,116,0
+ForegroundNormal=252,252,252
+ForegroundPositive=39,174,96
+ForegroundVisited=155,89,182
+
+[Colors:Header]
+BackgroundAlternate=49,54,59
+BackgroundNormal=49,54,59
+DecorationFocus=61,174,233
+DecorationHover=61,174,233
+ForegroundActive=61,174,233
+ForegroundInactive=161,169,177
+ForegroundLink=29,153,243
+ForegroundNegative=218,68,83
+ForegroundNeutral=246,116,0
+ForegroundNormal=252,252,252
+ForegroundPositive=39,174,96
+ForegroundVisited=155,89,182
+
+[Colors:Header][Inactive]
+BackgroundAlternate=49,54,59
+BackgroundNormal=42,46,50
+DecorationFocus=61,174,233
+DecorationHover=61,174,233
+ForegroundActive=61,174,233
+ForegroundInactive=161,169,177
+ForegroundLink=29,153,243
+ForegroundNegative=218,68,83
+ForegroundNeutral=246,116,0
+ForegroundNormal=252,252,252
+ForegroundPositive=39,174,96
+ForegroundVisited=155,89,182
+
+[Colors:Selection]
+BackgroundAlternate=21,83,158
+BackgroundNormal=21,83,158
+DecorationFocus=61,174,233
+DecorationHover=61,174,233
+ForegroundActive=252,252,252
+ForegroundInactive=161,169,177
+ForegroundLink=253,188,75
+ForegroundNegative=176,55,69
+ForegroundNeutral=198,92,0
+ForegroundNormal=252,253,254
+ForegroundPositive=23,104,57
+ForegroundVisited=155,89,182
+
+[Colors:Tooltip]
+BackgroundAlternate=255,255,255
+BackgroundNormal=255,255,255
+DecorationFocus=61,174,233
+DecorationHover=61,174,233
+ForegroundActive=61,174,233
+ForegroundInactive=161,169,177
+ForegroundLink=29,153,243
+ForegroundNegative=218,68,83
+ForegroundNeutral=246,116,0
+ForegroundNormal=0,0,0
+ForegroundPositive=39,174,96
+ForegroundVisited=155,89,182
+
+[Colors:View]
+BackgroundAlternate=45,45,45
+BackgroundNormal=45,45,45
+DecorationFocus=61,174,233
+DecorationHover=61,174,233
+ForegroundActive=61,174,233
+ForegroundInactive=161,169,177
+ForegroundLink=29,153,243
+ForegroundNegative=218,68,83
+ForegroundNeutral=246,116,0
+ForegroundNormal=255,255,255
+ForegroundPositive=39,174,96
+ForegroundVisited=155,89,182
+
+[Colors:Window]
+BackgroundAlternate=53,53,53
+BackgroundNormal=53,53,53
+DecorationFocus=61,174,233
+DecorationHover=61,174,233
+ForegroundActive=61,174,233
+ForegroundInactive=161,169,177
+ForegroundLink=29,153,243
+ForegroundNegative=218,68,83
+ForegroundNeutral=246,116,0
+ForegroundNormal=225,225,223
+ForegroundPositive=39,174,96
+ForegroundVisited=155,89,182
+
+[General]
+ColorScheme=BreezeDark
+Name=AdwaitaDark
+shadeSortColumn=true
+
+[KDE]
+contrast=4
+
+[WM]
+activeBackground=41,41,41
+activeBlend=252,252,252
+activeForeground=225,225,223
+inactiveBackground=42,46,50
+inactiveBlend=161,169,177
+inactiveForeground=161,169,177
diff --git a/src/color-schemes/AdwaitaHighcontrast.colors b/src/color-schemes/AdwaitaHighcontrast.colors
new file mode 100644
index 0000000..50f4aa9
--- /dev/null
+++ b/src/color-schemes/AdwaitaHighcontrast.colors
@@ -0,0 +1,120 @@
+[ColorEffects:Disabled]
+Color=56,56,56
+ColorAmount=0
+ColorEffect=0
+ContrastAmount=0.65
+ContrastEffect=1
+IntensityAmount=0.1
+IntensityEffect=2
+
+[ColorEffects:Inactive]
+ChangeSelectionColor=true
+Color=112,111,110
+ColorAmount=0.025
+ColorEffect=2
+ContrastAmount=0.1
+ContrastEffect=2
+Enable=false
+IntensityAmount=0
+IntensityEffect=0
+
+[Colors:Button]
+BackgroundAlternate=248,246,245
+BackgroundNormal=248,246,245
+DecorationFocus=61,174,233
+DecorationHover=147,206,233
+ForegroundActive=61,174,233
+ForegroundInactive=127,140,141
+ForegroundLink=41,128,185
+ForegroundNegative=218,68,83
+ForegroundNeutral=198,92,0
+ForegroundNormal=47,52,54
+ForegroundPositive=39,174,96
+ForegroundVisited=127,140,141
+
+[Colors:Complementary]
+BackgroundAlternate=59,64,69
+BackgroundNormal=49,54,59
+DecorationFocus=30,146,255
+DecorationHover=61,174,230
+ForegroundActive=147,206,233
+ForegroundInactive=175,176,179
+ForegroundLink=61,174,230
+ForegroundNegative=231,76,60
+ForegroundNeutral=253,188,75
+ForegroundNormal=239,240,241
+ForegroundPositive=46,204,113
+ForegroundVisited=61,174,230
+
+[Colors:Selection]
+BackgroundAlternate=53,132,228
+BackgroundNormal=53,132,228
+DecorationFocus=61,174,233
+DecorationHover=147,206,233
+ForegroundActive=252,252,252
+ForegroundInactive=239,240,241
+ForegroundLink=253,188,75
+ForegroundNegative=176,55,69
+ForegroundNeutral=246,116,0
+ForegroundNormal=252,253,255
+ForegroundPositive=23,104,57
+ForegroundVisited=189,195,199
+
+[Colors:Tooltip]
+BackgroundAlternate=0,0,0
+BackgroundNormal=0,0,0
+DecorationFocus=61,174,233
+DecorationHover=147,206,233
+ForegroundActive=61,174,233
+ForegroundInactive=189,195,199
+ForegroundLink=41,128,185
+ForegroundNegative=218,68,83
+ForegroundNeutral=246,116,0
+ForegroundNormal=255,255,255
+ForegroundPositive=39,174,96
+ForegroundVisited=127,140,141
+
+[Colors:View]
+BackgroundAlternate=255,255,255
+BackgroundNormal=255,255,255
+DecorationFocus=61,174,233
+DecorationHover=147,206,233
+ForegroundActive=61,174,233
+ForegroundInactive=25,25,25
+ForegroundLink=41,128,185
+ForegroundNegative=218,68,83
+ForegroundNeutral=246,116,0
+ForegroundNormal=3,3,3
+ForegroundPositive=39,174,96
+ForegroundVisited=127,140,141
+
+[Colors:Window]
+BackgroundAlternate=253,253,252
+BackgroundNormal=253,253,252
+DecorationFocus=61,174,233
+DecorationHover=147,206,233
+ForegroundActive=61,174,233
+ForegroundInactive=127,140,141
+ForegroundLink=41,128,185
+ForegroundNegative=218,68,83
+ForegroundNeutral=246,116,0
+ForegroundNormal=42,47,49
+ForegroundPositive=39,174,96
+ForegroundVisited=127,140,141
+
+[General]
+ColorScheme=BreezeClassic
+Name=AdwaitaHighcontrast
+TitlebarIsAccentColored=true
+shadeSortColumn=true
+
+[KDE]
+contrast=4
+
+[WM]
+activeBackground=228,226,223
+activeBlend=252,252,252
+activeForeground=42,47,49
+inactiveBackground=239,240,241
+inactiveBlend=75,71,67
+inactiveForeground=189,195,199
diff --git a/src/color-schemes/AdwaitaHighcontrastInverse.colors b/src/color-schemes/AdwaitaHighcontrastInverse.colors
new file mode 100644
index 0000000..b665c20
--- /dev/null
+++ b/src/color-schemes/AdwaitaHighcontrastInverse.colors
@@ -0,0 +1,147 @@
+[ColorEffects:Disabled]
+Color=56,56,56
+ColorAmount=0
+ColorEffect=0
+ContrastAmount=0.65
+ContrastEffect=1
+IntensityAmount=0.1
+IntensityEffect=2
+
+[ColorEffects:Inactive]
+ChangeSelectionColor=true
+Color=112,111,110
+ColorAmount=0.025
+ColorEffect=2
+ContrastAmount=0.1
+ContrastEffect=2
+Enable=false
+IntensityAmount=0
+IntensityEffect=0
+
+[Colors:Button]
+BackgroundAlternate=52,52,52
+BackgroundNormal=52,52,52
+DecorationFocus=61,174,233
+DecorationHover=61,174,233
+ForegroundActive=61,174,233
+ForegroundInactive=161,169,177
+ForegroundLink=29,153,243
+ForegroundNegative=218,68,83
+ForegroundNeutral=246,116,0
+ForegroundNormal=238,238,236
+ForegroundPositive=39,174,96
+ForegroundVisited=155,89,182
+
+[Colors:Complementary]
+BackgroundAlternate=30,87,116
+BackgroundNormal=42,46,50
+DecorationFocus=61,174,233
+DecorationHover=61,174,233
+ForegroundActive=61,174,233
+ForegroundInactive=161,169,177
+ForegroundLink=29,153,243
+ForegroundNegative=218,68,83
+ForegroundNeutral=246,116,0
+ForegroundNormal=252,252,252
+ForegroundPositive=39,174,96
+ForegroundVisited=155,89,182
+
+[Colors:Header]
+BackgroundAlternate=49,54,59
+BackgroundNormal=49,54,59
+DecorationFocus=61,174,233
+DecorationHover=61,174,233
+ForegroundActive=61,174,233
+ForegroundInactive=161,169,177
+ForegroundLink=29,153,243
+ForegroundNegative=218,68,83
+ForegroundNeutral=246,116,0
+ForegroundNormal=252,252,252
+ForegroundPositive=39,174,96
+ForegroundVisited=155,89,182
+
+[Colors:Header][Inactive]
+BackgroundAlternate=49,54,59
+BackgroundNormal=42,46,50
+DecorationFocus=61,174,233
+DecorationHover=61,174,233
+ForegroundActive=61,174,233
+ForegroundInactive=161,169,177
+ForegroundLink=29,153,243
+ForegroundNegative=218,68,83
+ForegroundNeutral=246,116,0
+ForegroundNormal=252,252,252
+ForegroundPositive=39,174,96
+ForegroundVisited=155,89,182
+
+[Colors:Selection]
+BackgroundAlternate=21,83,158
+BackgroundNormal=21,83,158
+DecorationFocus=61,174,233
+DecorationHover=61,174,233
+ForegroundActive=252,252,252
+ForegroundInactive=161,169,177
+ForegroundLink=253,188,75
+ForegroundNegative=176,55,69
+ForegroundNeutral=198,92,0
+ForegroundNormal=252,253,254
+ForegroundPositive=23,104,57
+ForegroundVisited=155,89,182
+
+[Colors:Tooltip]
+BackgroundAlternate=255,255,255
+BackgroundNormal=255,255,255
+DecorationFocus=61,174,233
+DecorationHover=61,174,233
+ForegroundActive=61,174,233
+ForegroundInactive=161,169,177
+ForegroundLink=29,153,243
+ForegroundNegative=218,68,83
+ForegroundNeutral=246,116,0
+ForegroundNormal=0,0,0
+ForegroundPositive=39,174,96
+ForegroundVisited=155,89,182
+
+[Colors:View]
+BackgroundAlternate=45,45,45
+BackgroundNormal=45,45,45
+DecorationFocus=61,174,233
+DecorationHover=61,174,233
+ForegroundActive=61,174,233
+ForegroundInactive=161,169,177
+ForegroundLink=29,153,243
+ForegroundNegative=218,68,83
+ForegroundNeutral=246,116,0
+ForegroundNormal=255,255,255
+ForegroundPositive=39,174,96
+ForegroundVisited=155,89,182
+
+[Colors:Window]
+BackgroundAlternate=53,53,53
+BackgroundNormal=53,53,53
+DecorationFocus=61,174,233
+DecorationHover=61,174,233
+ForegroundActive=61,174,233
+ForegroundInactive=161,169,177
+ForegroundLink=29,153,243
+ForegroundNegative=218,68,83
+ForegroundNeutral=246,116,0
+ForegroundNormal=225,225,223
+ForegroundPositive=39,174,96
+ForegroundVisited=155,89,182
+
+[General]
+ColorScheme=BreezeDark
+Name=AdwaitaHighcontrastInverse
+shadeSortColumn=true
+
+[KDE]
+contrast=4
+
+[WM]
+activeBackground=41,41,41
+activeBlend=252,252,252
+activeForeground=225,225,223
+inactiveBackground=42,46,50
+inactiveBlend=161,169,177
+inactiveForeground=161,169,177
diff --git a/src/color-schemes/CMakeLists.txt b/src/color-schemes/CMakeLists.txt
new file mode 100644
index 0000000..e156bfa
--- /dev/null
+++ b/src/color-schemes/CMakeLists.txt
@@ -0,0 +1,4 @@
+install(FILES Adwaita.colors DESTINATION ${CMAKE_INSTALL_DATADIR}/color-schemes/)
+install(FILES AdwaitaDark.colors DESTINATION ${CMAKE_INSTALL_DATADIR}/color-schemes/)
+install(FILES AdwaitaHighcontrast.colors DESTINATION ${CMAKE_INSTALL_DATADIR}/color-schemes/)
+install(FILES AdwaitaHighcontrastInverse.colors DESTINATION ${CMAKE_INSTALL_DATADIR}/color-schemes/)
diff --git a/src/common/gnomesettings.cpp b/src/common/gnomesettings.cpp
index 078b1a9..1be8d61 100644
--- a/src/common/gnomesettings.cpp
+++ b/src/common/gnomesettings.cpp
@@ -256,6 +256,18 @@ GnomeSettings::TitlebarButtonsPlacement GnomeSettings::titlebarButtonPlacement()
return m_hintProvider->titlebarButtonPlacement();
}
+static QString colorScheme(bool useHighContrast, bool useDarkVariant)
+{
+ QString colorScheme = QStringLiteral("/usr/share/color-schemes/");
+ if (useHighContrast) {
+ colorScheme += useDarkVariant ? QStringLiteral("AdwaitaHighcontrastInverse.colors") : QStringLiteral("AdwaitaHighcontrast.colors");
+ } else {
+ colorScheme += useDarkVariant ? QStringLiteral("AdwaitaDark.colors") : QStringLiteral("Adwaita.colors");
+ }
+
+ return colorScheme;
+}
+
void GnomeSettings::loadPalette()
{
if (useGtkThemeHighContrastVariant()) {
@@ -264,6 +276,8 @@ void GnomeSettings::loadPalette()
} else {
m_palette = new QPalette(Adwaita::Colors::palette(useGtkThemeDarkVariant() ? Adwaita::ColorVariant::AdwaitaDark : Adwaita::ColorVariant::Adwaita));
}
+
+ qApp->setProperty("KDE_COLOR_SCHEME_PATH", colorScheme(useGtkThemeHighContrastVariant(), useGtkThemeDarkVariant()));
}
void GnomeSettings::onCursorBlinkTimeChanged()

View File

@ -1,76 +0,0 @@
From d649368961f9b3f80b307ffa02cf3090fa29e140 Mon Sep 17 00:00:00 2001
From: Jan Grulich <jgrulich@redhat.com>
Date: Tue, 4 Apr 2023 13:54:44 +0200
Subject: [PATCH] Fix build against Qt 6.5
---
src/theme/qgnomeplatformtheme.cpp | 13 +++++++++----
src/theme/qgnomeplatformtheme.h | 6 ++++--
2 files changed, 13 insertions(+), 6 deletions(-)
diff --git a/src/theme/qgnomeplatformtheme.cpp b/src/theme/qgnomeplatformtheme.cpp
index 8296647..42f0e84 100644
--- a/src/theme/qgnomeplatformtheme.cpp
+++ b/src/theme/qgnomeplatformtheme.cpp
@@ -83,7 +83,7 @@ QGnomePlatformTheme::QGnomePlatformTheme()
g_type_ensure(PANGO_TYPE_FONT_FAMILY);
g_type_ensure(PANGO_TYPE_FONT_FACE);
-#if QT_VERSION > 0x060000
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
// Load QGnomeTheme
m_platformTheme = QGenericUnixTheme::createUnixTheme(QLatin1String("gnome"));
#endif
@@ -148,7 +148,7 @@ QPlatformDialogHelper *QGnomePlatformTheme::createPlatformDialogHelper(QPlatform
}
}
-#if QT_VERSION < 0x060000
+#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
#ifndef QT_NO_SYSTEMTRAYICON
static bool isDBusTrayAvailable()
{
@@ -169,7 +169,7 @@ static bool isDBusTrayAvailable()
#ifndef QT_NO_SYSTEMTRAYICON
QPlatformSystemTrayIcon *QGnomePlatformTheme::createPlatformSystemTrayIcon() const
{
-#if QT_VERSION < 0x060000
+#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
if (isDBusTrayAvailable()) {
return new QDBusTrayIcon();
}
@@ -182,7 +182,12 @@ QPlatformSystemTrayIcon *QGnomePlatformTheme::createPlatformSystemTrayIcon() con
}
#endif
-#if QT_VERSION > 0x060300
+#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0)
+Qt::ColorScheme QGnomePlatformTheme::colorScheme() const
+{
+ return GnomeSettings::getInstance().useGtkThemeDarkVariant() ? Qt::ColorScheme::Dark : Qt::ColorScheme::Light;
+}
+#elif QT_VERSION >= QT_VERSION_CHECK(6, 3, 0)
QPlatformTheme::Appearance QGnomePlatformTheme::appearance() const
{
return GnomeSettings::getInstance().useGtkThemeDarkVariant() ? Appearance::Dark : Appearance::Light;
diff --git a/src/theme/qgnomeplatformtheme.h b/src/theme/qgnomeplatformtheme.h
index 342909f..a37475d 100644
--- a/src/theme/qgnomeplatformtheme.h
+++ b/src/theme/qgnomeplatformtheme.h
@@ -39,12 +39,14 @@ class QGnomePlatformTheme : public QPlatformTheme
#ifndef QT_NO_SYSTEMTRAYICON
QPlatformSystemTrayIcon *createPlatformSystemTrayIcon() const Q_DECL_OVERRIDE;
#endif
-#if QT_VERSION > 0x060300
+#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0)
+ Qt::ColorScheme colorScheme() const Q_DECL_OVERRIDE;
+#elif QT_VERSION >= QT_VERSION_CHECK(6, 3, 0)
QPlatformTheme::Appearance appearance() const Q_DECL_OVERRIDE;
#endif
private:
-#if QT_VERSION > 0x060000
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
// Used to load Qt's internall platform theme to get access to
// non-public stuff, like QDBusTrayIcon
QPlatformTheme *m_platformTheme = nullptr;

View File

@ -1,11 +0,0 @@
--- a/src/decoration/qgnomeplatformdecoration.cpp
+++ b/src/decoration/qgnomeplatformdecoration.cpp
@@ -620,7 +620,7 @@ bool QGnomePlatformDecoration::handleTouch(QWaylandInputDevice *inputDevice,
QRect QGnomePlatformDecoration::windowContentGeometry() const
{
-#if QT_VERSION >= 0x060000
+#ifdef DECORATION_SHADOWS_SUPPORT // Qt 6.2.0+ or patched QtWayland
return waylandWindow()->windowContentGeometry() + margins(ShadowsOnly);
#else
return waylandWindow()->windowContentGeometry();

View File

@ -1,49 +0,0 @@
diff --git a/src/decoration/qgnomeplatformdecoration.cpp b/src/decoration/qgnomeplatformdecoration.cpp
index b05a9b4..7f2ae9a 100644
--- a/src/decoration/qgnomeplatformdecoration.cpp
+++ b/src/decoration/qgnomeplatformdecoration.cpp
@@ -182,7 +182,7 @@ QMargins QGnomePlatformDecoration::margins(MarginsType marginsType) const
#else
QMargins QGnomePlatformDecoration::margins() const
{
- if ((window()->windowStates() & Qt::WindowMaximized)) {
+ if ((waylandWindow()->windowStates() & Qt::WindowMaximized)) {
return QMargins(0, TITLEBAR_HEIGHT, 0, 0);
}
@@ -372,7 +372,7 @@ void QGnomePlatformDecoration::paint(QPaintDevice *device)
// * *
// ********************************
QPainterPath borderRect;
- if (!(window()->windowStates() & Qt::WindowMaximized)) {
+ if (!(waylandWindow()->windowStates() & Qt::WindowMaximized)) {
borderRect.addRoundedRect(0, 0, surfaceRect.width(), margins().top() + 8, 10, 10);
p.fillPath(borderRect.simplified(), borderColor);
}
@@ -390,7 +390,7 @@ void QGnomePlatformDecoration::paint(QPaintDevice *device)
// * *
// ********************************
QPainterPath roundedRect;
- if ((window()->windowStates() & Qt::WindowMaximized)) {
+ if ((waylandWindow()->windowStates() & Qt::WindowMaximized)) {
roundedRect.addRect(0, 0, surfaceRect.width(), margins().top() + 8);
} else {
roundedRect
@@ -414,7 +414,7 @@ void QGnomePlatformDecoration::paint(QPaintDevice *device)
// *| |*
// *------------------------------*
// ********************************
- if (!(window()->windowStates() & Qt::WindowMaximized)) {
+ if (!(waylandWindow()->windowStates() & Qt::WindowMaximized)) {
QPainterPath borderPath;
// Left
borderPath.addRect(0, margins().top(), margins().left(), surfaceRect.height() - margins().top() - WINDOW_BORDER_WIDTH);
@@ -499,7 +499,7 @@ void QGnomePlatformDecoration::paint(QPaintDevice *device)
if (GnomeSettings::getInstance().titlebarButtons().testFlag(GnomeSettings::getInstance().MaximizeButton)) {
renderButton(&p,
maximizeButtonRect(),
- (window()->windowStates() & Qt::WindowMaximized) ? Adwaita::ButtonType::ButtonRestore : Adwaita::ButtonType::ButtonMaximize,
+ (waylandWindow()->windowStates() & Qt::WindowMaximized) ? Adwaita::ButtonType::ButtonRestore : Adwaita::ButtonType::ButtonMaximize,
m_maximizeButtonHovered && active,
m_clicking == Button::Maximize || m_clicking == Button::Restore);
}

View File

@ -1,6 +1,6 @@
Name: qgnomeplatform
Version: 0.9.0
Release: 13%{?dist}
Version: 0.9.1
Release: 1%{?dist}
Summary: Qt Platform Theme aimed to accommodate Gnome settings
License: LGPL-2.0-or-later
@ -8,11 +8,6 @@ URL: https://github.com/FedoraQt/QGnomePlatform
Source0: https://github.com/FedoraQt/QGnomePlatform/archive/%{version}/QGnomePlatform-%{version}.tar.gz
# Upstream patches
Patch0: qgnomeplatform-fix-window-content-geometry-for-qt5-when-shadows-are-enabled.patch
Patch1: qgnomeplatform-add-support-for-kcolorscheme-using-adwaita-like-color-schemes.patch
Patch3: qgnomeplatform-fix-qt6-build.patch
Patch50: qgnomeplatform-use-more-updated-window-states-value.patch
BuildRequires: make
BuildRequires: pkgconfig(gio-2.0)
@ -32,6 +27,7 @@ modifying them - making them fit into the environment as well as possible.
Summary: Qt5 Platform Theme aimed to accommodate Gnome settings
BuildRequires: qt5-qtbase-devel >= 5.15.2
BuildRequires: qt5-qtbase-static >= 5.15.2
BuildRequires: qt5-qtquickcontrols2-devel >= 5.15.2
BuildRequires: qt5-qtwayland-devel >= 5.15.2
BuildRequires: qt5-qtbase-private-devel >= 5.15.2
%{?_qt5:Requires: %{_qt5}%{?_isa} = %{_qt5_version}}
@ -58,6 +54,7 @@ modifying them - making them fit into the environment as well as possible.
Summary: Qt6 Platform Theme aimed to accommodate Gnome settings
BuildRequires: qt6-qtbase-devel >= 6.2.0
BuildRequires: qt6-qtbase-static >= 6.2.0
BuildRequires: qt6-qtquickcontrols2-devel >= 6.2.0
BuildRequires: qt6-qtwayland-devel >= 6.2.0
BuildRequires: qt6-qtbase-private-devel >= 6.2.0
@ -109,6 +106,9 @@ modifying them - making them fit into the environment as well as possible.
%{_qt6_plugindir}/wayland-decoration-client/libqgnomeplatformdecoration.so
%changelog
* Thu May 11 2023 Jan Grulich <jgrulich@redhat.com> - 0.9.1-1
- 0.9.1
* Wed Apr 12 2023 Jan Grulich <jgrulich@redhat.com> - 0.9.0-13
- Rebuild (qt5)

View File

@ -1 +1 @@
SHA512 (QGnomePlatform-0.9.0.tar.gz) = 7671b0659959ede79e47a821481a14ed861418f364d3d0b48789b1edfcf3b84f2aa658e3afce95730a841fdb018ebad38474a83268bd43b1ccfb653ef7e314aa
SHA512 (QGnomePlatform-0.9.1.tar.gz) = 1b8f5d3241bbaa830858dc256285f91023a6e9f664c9920ebfdaf8bdc759e3c958a22bc52eb3559a86d96007118b8ce5efa900167feb491a60232b365c00784c