Fix checkbox and radiobutton background in QGtk3Theme

The background color for radio buttons and checkboxes was not
correctly read from the current GTK3 theme in light mode.
This has lead to identical colors for indicators and background of
radio buttons and checkboxes for certain GTK themes (e.g. Breeze).

This patch sets the GTK default foreground color to the base color of
palettes for checkboxes and radio buttons.

Fixes: QTBUG-109454
Change-Id: Ic227029f2d366aa826e7bf1c3870428e3b638638
Reviewed-by: Jonas Kvinge <jonas@jkvinge.net>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
(cherry picked from commit 2c9b7a986d08e8f9b858973a2ad479e1a83adb13)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Axel Spoerl 2022-12-16 11:37:34 +01:00 committed by Qt Cherry-pick Bot
parent e83eb06a72
commit 2b4ce4bc5a

View File

@ -530,7 +530,6 @@ void QGtk3Storage::createMapping()
ADD(Normal, Button);
ADD(Normal, Base);
ADD(Inactive, Base);
ADD(Normal, Window); // redundant
ADD(Inactive, Window);
LIGHTER(Normal, Window, 125);
ADD(Normal, Light);
@ -544,7 +543,6 @@ void QGtk3Storage::createMapping()
LIGHTER(Normal, WindowText, 50);
ADD(Disabled, Text);
ADD(Disabled, WindowText);
//ADD(Normal, ButtonText);
ADD(Inactive, ButtonText);
GTK(button, Text, NORMAL);
ADD(Disabled, ButtonText);
@ -580,6 +578,8 @@ void QGtk3Storage::createMapping()
// Checkbox and Radio Button
GTK(button, Text, ACTIVE);
ADD(Normal, Base, Dark);
GTK(Default, Background, NORMAL);
ADD(All, Base);
GTK(button, Text, NORMAL);
ADD(Normal, Base, Light);
SAVE(CheckBoxPalette);