From 4724a07c6a53a1856487f363ca6a69b8fa97c282 Mon Sep 17 00:00:00 2001 From: Jan Grulich Date: Tue, 18 Apr 2023 13:53:44 +0200 Subject: [PATCH] 0.9.0 Resolves: bz#2175753 --- .gitignore | 1 + ...eme-using-adwaita-like-color-schemes.patch | 629 ++++++++++++++++++ ...try-for-qt5-when-shadows-are-enabled.patch | 11 + ...use-more-updated-window-states-value.patch | 26 +- qgnomeplatform.spec | 18 +- sources | 2 +- 6 files changed, 668 insertions(+), 19 deletions(-) create mode 100644 qgnomeplatform-add-support-for-kcolorscheme-using-adwaita-like-color-schemes.patch create mode 100644 qgnomeplatform-fix-window-content-geometry-for-qt5-when-shadows-are-enabled.patch diff --git a/.gitignore b/.gitignore index 7b1d75d..839c345 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,4 @@ /QGnomePlatform-0.7.1.tar.gz /QGnomePlatform-0.8.0.tar.gz /QGnomePlatform-0.8.4.tar.gz +/QGnomePlatform-0.9.0.tar.gz diff --git a/qgnomeplatform-add-support-for-kcolorscheme-using-adwaita-like-color-schemes.patch b/qgnomeplatform-add-support-for-kcolorscheme-using-adwaita-like-color-schemes.patch new file mode 100644 index 0000000..7d0ed3c --- /dev/null +++ b/qgnomeplatform-add-support-for-kcolorscheme-using-adwaita-like-color-schemes.patch @@ -0,0 +1,629 @@ +From d9c0210ac45f7de71750655a3ca0d89581d19f88 Mon Sep 17 00:00:00 2001 +From: Jan Grulich +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() diff --git a/qgnomeplatform-fix-window-content-geometry-for-qt5-when-shadows-are-enabled.patch b/qgnomeplatform-fix-window-content-geometry-for-qt5-when-shadows-are-enabled.patch new file mode 100644 index 0000000..5c09adf --- /dev/null +++ b/qgnomeplatform-fix-window-content-geometry-for-qt5-when-shadows-are-enabled.patch @@ -0,0 +1,11 @@ +--- 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(); diff --git a/qgnomeplatform-use-more-updated-window-states-value.patch b/qgnomeplatform-use-more-updated-window-states-value.patch index f67f458..b84ac8f 100644 --- a/qgnomeplatform-use-more-updated-window-states-value.patch +++ b/qgnomeplatform-use-more-updated-window-states-value.patch @@ -1,8 +1,8 @@ diff --git a/src/decoration/qgnomeplatformdecoration.cpp b/src/decoration/qgnomeplatformdecoration.cpp -index a719cb3..1346a01 100644 +index b05a9b4..7f2ae9a 100644 --- a/src/decoration/qgnomeplatformdecoration.cpp +++ b/src/decoration/qgnomeplatformdecoration.cpp -@@ -180,7 +180,7 @@ QMargins QGnomePlatformDecoration::margins(MarginsType marginsType) const +@@ -182,7 +182,7 @@ QMargins QGnomePlatformDecoration::margins(MarginsType marginsType) const #else QMargins QGnomePlatformDecoration::margins() const { @@ -11,7 +11,7 @@ index a719cb3..1346a01 100644 return QMargins(0, TITLEBAR_HEIGHT, 0, 0); } -@@ -373,7 +373,7 @@ void QGnomePlatformDecoration::paint(QPaintDevice *device) +@@ -372,7 +372,7 @@ void QGnomePlatformDecoration::paint(QPaintDevice *device) // * * // ******************************** QPainterPath borderRect; @@ -20,7 +20,7 @@ index a719cb3..1346a01 100644 borderRect.addRoundedRect(0, 0, surfaceRect.width(), margins().top() + 8, 10, 10); p.fillPath(borderRect.simplified(), borderColor); } -@@ -391,7 +391,7 @@ void QGnomePlatformDecoration::paint(QPaintDevice *device) +@@ -390,7 +390,7 @@ void QGnomePlatformDecoration::paint(QPaintDevice *device) // * * // ******************************** QPainterPath roundedRect; @@ -28,7 +28,7 @@ index a719cb3..1346a01 100644 + if ((waylandWindow()->windowStates() & Qt::WindowMaximized)) { roundedRect.addRect(0, 0, surfaceRect.width(), margins().top() + 8); } else { - roundedRect.addRoundedRect(WINDOW_BORDER_WIDTH, WINDOW_BORDER_WIDTH, surfaceRect.width() - margins().left() - margins().right(), margins().top() + 8, 8, 8); + roundedRect @@ -414,7 +414,7 @@ void QGnomePlatformDecoration::paint(QPaintDevice *device) // *| |* // *------------------------------* @@ -38,12 +38,12 @@ index a719cb3..1346a01 100644 QPainterPath borderPath; // Left borderPath.addRect(0, margins().top(), margins().left(), surfaceRect.height() - margins().top() - WINDOW_BORDER_WIDTH); -@@ -498,7 +498,7 @@ void QGnomePlatformDecoration::paint(QPaintDevice *device) - - // Maximize button - if (GnomeSettings::titlebarButtons().testFlag(GnomeSettings::MaximizeButton)) { -- renderButton(&p, maximizeButtonRect(), (window()->windowStates() & Qt::WindowMaximized) ? Adwaita::ButtonType::ButtonRestore : Adwaita::ButtonType::ButtonMaximize, -+ renderButton(&p, maximizeButtonRect(), (waylandWindow()->windowStates() & Qt::WindowMaximized) ? Adwaita::ButtonType::ButtonRestore : Adwaita::ButtonType::ButtonMaximize, - m_maximizeButtonHovered && active, m_clicking == Button::Maximize || m_clicking == Button::Restore); +@@ -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); } - diff --git a/qgnomeplatform.spec b/qgnomeplatform.spec index 630b3fd..e2230aa 100644 --- a/qgnomeplatform.spec +++ b/qgnomeplatform.spec @@ -1,7 +1,7 @@ Name: qgnomeplatform -Version: 0.8.4 -Release: 2%{?dist} +Version: 0.9.0 +Release: 1%{?dist} Summary: Qt Platform Theme aimed to accommodate Gnome settings License: LGPLv2+ @@ -9,7 +9,10 @@ URL: https://github.com/MartinBriza/QGnomePlatform Source0: https://github.com/MartinBriza/QGnomePlatform/archive/%{version}/QGnomePlatform-%{version}.tar.gz # Upstream patches -Patch0: qgnomeplatform-use-more-updated-window-states-value.patch +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 + +Patch50: qgnomeplatform-use-more-updated-window-states-value.patch BuildRequires: make BuildRequires: pkgconfig(gio-2.0) @@ -50,11 +53,16 @@ modifying them - making them fit into the environment as well as possible. %files %doc README.md %license LICENSE +%{_datadir}/color-schemes/*.colors %{_qt5_libdir}/libqgnomeplatform.so -%{_qt5_libdir}/qt5/plugins/platformthemes/libqgnomeplatformtheme.so -%{_qt5_libdir}/qt5/plugins/wayland-decoration-client/libqgnomeplatformdecoration.so +%{_qt5_plugindir}/platformthemes/libqgnomeplatformtheme.so +%{_qt5_plugindir}/wayland-decoration-client/libqgnomeplatformdecoration.so %changelog +* Tue Apr 18 2023 Jan Grulich - 0.9.0-1 +- 0.9.0 + Resolves: bz#2175753 + * Fri Apr 01 2022 Jan Grulich - 0.8.4-2 - Rebuild (Qt 5.15.3) Resolves: bz#2061415 diff --git a/sources b/sources index 6db8592..9ddac3c 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (QGnomePlatform-0.8.4.tar.gz) = e5bb5feae401bca145c4b7a4fc18f5a589e2acba20b9ce7d04a7dd1b1734741daf210ff8fba5e03ef5e4ad07efd274a1279e61b359f319b52e3b9bc4d49f9142 +SHA512 (QGnomePlatform-0.9.0.tar.gz) = 7671b0659959ede79e47a821481a14ed861418f364d3d0b48789b1edfcf3b84f2aa658e3afce95730a841fdb018ebad38474a83268bd43b1ccfb653ef7e314aa