QGtk3Theme: Do not default Active WindowText to button foreground

QGtk3Theme uses the GTK button foreground as a default for the
WindowText color role. When a GTK3 theme has no specific color for the
entry text, this can lead to text on certain assets looking darker
and thus disabled.

This discontinues usage of the button foreground for the window text.

Finding the WindowText color role in QPlatformTheme::SystemPalette now
follows the following logic:
(1) GTK normal entry text is used if specified. This is the preferred
option, copying GTK behavior.
(2) If (1) is not specified, the GTK default text color is used, making
WindowText equal to Text.
(3) If neither (1), nor (2) are specified, the WindowText color role is
taken from qt_fusionPalette, where it is also equal to Text.

The SystemPalette is used as a default template for all other control
or widget speicific palettes. The rules above therefor apply to all
screen assets (unless they use a JSON file to specify a their
individual WindowText).

[ChangeLog][QGtk3Theme][SystemPalette][WindowText] Default to GTK
Entry Text / Normal Text / qt_fusionPalette

Fixes: QTBUG-114600
Pick-to: 6.6 6.5.2 6.5
Change-Id: I4c96ac7d096526faf4c2feee436753990c6c9f92
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
This commit is contained in:
Axel Spoerl 2023-06-26 11:48:40 +02:00
parent a3ec70a929
commit 574a47dd5a

View File

@ -538,7 +538,6 @@ void QGtk3Storage::createMapping()
LIGHTER(Normal, Window, 80);
ADD(Normal, Dark);
GTK(button, Foreground, ACTIVE);
ADD(Normal, WindowText);
ADD(Inactive, WindowText);
LIGHTER(Normal, WindowText, 50);
ADD(Disabled, Text);
@ -562,6 +561,7 @@ void QGtk3Storage::createMapping()
ADD(Disabled, HighlightedText);
GTK(Default, Text, NORMAL);
ADD(Normal, Text);
ADD(Normal, WindowText);
ADD(Inactive, Text);
ADD(Normal, HighlightedText);
LIGHTER(Normal, Base, 93);