Fix disabled button color in Linux (X11/Wayland)

The palette mapping table (as read from gtk widget) maintained in
QGtk3Storage misses information of QPalette::Button and
QPalette::ButtonText role for QPalette::Disabled color group. This
cause disabled button widget to be rendered with incorrect palette
(such as in dark color scheme, light palette had been used).

This patch fixes this issue by extending palette mapping in
QGtk3Storage for disabled color group of button role.

Fixes: QTBUG-113486
Pick-to: 6.6.0 6.5
Change-Id: Ied4b2650c92cc1cda58be69257945991013b276f
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 4cffb3b5fbbad24fed26690c3e10c0332cb0b33f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Santhosh Kumar 2023-10-09 13:17:19 +02:00 committed by Qt Cherry-pick Bot
parent 5097f3fa33
commit 3e971798e7

View File

@ -531,6 +531,8 @@ void QGtk3Storage::createMapping()
ADD(Normal, Base);
ADD(Inactive, Base);
ADD(Inactive, Window);
ADD(Disabled, Button);
ADD(Disabled, Window);
LIGHTER(Normal, Window, 125);
ADD(Normal, Light);
LIGHTER(Normal, Window, 70);
@ -543,6 +545,7 @@ void QGtk3Storage::createMapping()
ADD(Disabled, Text);
ADD(Disabled, WindowText);
ADD(Inactive, ButtonText);
ADD(Disabled, ButtonText);
GTK(button, Text, NORMAL);
ADD(Disabled, ButtonText);
// special background colors