d2061e2
From 6a9a896ae86a69a3c8bcbaaf7e2e2fd2105723a4 Mon Sep 17 00:00:00 2001
6ad7f13
From: Jan Grulich <jgrulich@redhat.com>
6ad7f13
Date: Thu, 27 Jul 2023 12:44:31 +0200
d2061e2
Subject: [PATCH 15/15] QGtk3Theme: Do not default Active WindowText to button
6ad7f13
 foreground
6ad7f13
6ad7f13
QGtk3Theme uses the GTK button foreground as a default for the
6ad7f13
WindowText color role. When a GTK3 theme has no specific color for the
6ad7f13
entry text, this can lead to text on certain assets looking darker
6ad7f13
and thus disabled.
6ad7f13
6ad7f13
This discontinues usage of the button foreground for the window text.
6ad7f13
6ad7f13
Finding the WindowText color role in QPlatformTheme::SystemPalette now
6ad7f13
follows the following logic:
6ad7f13
(1) GTK normal entry text is used if specified. This is the preferred
6ad7f13
option, copying GTK behavior.
6ad7f13
(2) If (1) is not specified, the GTK default text color is used, making
6ad7f13
WindowText equal to Text.
6ad7f13
(3) If neither (1), nor (2) are specified, the WindowText color role is
6ad7f13
taken from qt_fusionPalette, where it is also equal to Text.
6ad7f13
6ad7f13
The SystemPalette is used as a default template for all other control
6ad7f13
or widget speicific palettes. The rules above therefor apply to all
6ad7f13
screen assets (unless they use a JSON file to specify a their
6ad7f13
individual WindowText).
6ad7f13
6ad7f13
[ChangeLog][QGtk3Theme][SystemPalette][WindowText] Default to GTK
6ad7f13
Entry Text / Normal Text / qt_fusionPalette
6ad7f13
---
6ad7f13
 src/plugins/platformthemes/gtk3/qgtk3storage.cpp | 2 +-
6ad7f13
 1 file changed, 1 insertion(+), 1 deletion(-)
6ad7f13
6ad7f13
diff --git a/src/plugins/platformthemes/gtk3/qgtk3storage.cpp b/src/plugins/platformthemes/gtk3/qgtk3storage.cpp
12ab19e
index 7775ac66e4..fb4069ba3c 100644
6ad7f13
--- a/src/plugins/platformthemes/gtk3/qgtk3storage.cpp
6ad7f13
+++ b/src/plugins/platformthemes/gtk3/qgtk3storage.cpp
6ad7f13
@@ -538,7 +538,6 @@ void QGtk3Storage::createMapping()
6ad7f13
     LIGHTER(Normal, Window, 80);
6ad7f13
     ADD(Normal, Dark);
6ad7f13
     GTK(button, Foreground, ACTIVE);
6ad7f13
-    ADD(Normal, WindowText);
6ad7f13
     ADD(Inactive, WindowText);
6ad7f13
     LIGHTER(Normal, WindowText, 50);
6ad7f13
     ADD(Disabled, Text);
6ad7f13
@@ -562,6 +561,7 @@ void QGtk3Storage::createMapping()
6ad7f13
     ADD(Disabled, HighlightedText);
6ad7f13
     GTK(Default, Text, NORMAL);
6ad7f13
     ADD(Normal, Text);
6ad7f13
+    ADD(Normal, WindowText);
6ad7f13
     ADD(Inactive, Text);
6ad7f13
     ADD(Normal, HighlightedText);
6ad7f13
     LIGHTER(Normal, Base, 93);
6ad7f13
-- 
6ad7f13
2.41.0
6ad7f13