From b7150d22c8ea6349b5d1fd61d5059e0fbe2745ed Mon Sep 17 00:00:00 2001 From: Richard Moe Gustavsen Date: Thu, 19 Aug 2021 11:17:03 +0200 Subject: QCocoaTheme: add ButtonText color to standard palette MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The standard palette had no value set for ButtonText. The result was the we drew button text in QtQuickControls2 using Text color instead, which would be wrong in dark mode, and result in a dark color instead of white. Note: Widgets hardcode the color "white" directly in the mac style, and was not affected by the missing value. Fixes: QTBUG-89177 Pick-to: 6.2 6.1 Change-Id: Ie2d99bfac9fcc70d45e5bd40ea45becf3fd70d87 Reviewed-by: Morten Johan Sørvig --- src/plugins/platforms/cocoa/qcocoatheme.mm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/plugins/platforms/cocoa') diff --git a/src/plugins/platforms/cocoa/qcocoatheme.mm b/src/plugins/platforms/cocoa/qcocoatheme.mm index 21f127103f..abb2aa03da 100644 --- a/src/plugins/platforms/cocoa/qcocoatheme.mm +++ b/src/plugins/platforms/cocoa/qcocoatheme.mm @@ -99,7 +99,6 @@ static QPalette *qt_mac_createSystemPalette() palette->setBrush(QPalette::Disabled, QPalette::WindowText, dark); palette->setBrush(QPalette::Disabled, QPalette::Text, dark); - palette->setBrush(QPalette::Disabled, QPalette::ButtonText, dark); palette->setBrush(QPalette::Disabled, QPalette::Base, backgroundBrush); QBrush textBackgroundBrush = qt_mac_toQBrush([NSColor textBackgroundColor]); palette->setBrush(QPalette::Active, QPalette::Base, textBackgroundBrush); @@ -124,6 +123,7 @@ static QPalette *qt_mac_createSystemPalette() qc = qt_mac_toQColor([NSColor controlTextColor]); palette->setColor(QPalette::Active, QPalette::Text, qc); + palette->setColor(QPalette::Active, QPalette::ButtonText, qc); palette->setColor(QPalette::Active, QPalette::WindowText, qc); palette->setColor(QPalette::Active, QPalette::HighlightedText, qc); palette->setColor(QPalette::Inactive, QPalette::Text, qc); @@ -132,6 +132,7 @@ static QPalette *qt_mac_createSystemPalette() qc = qt_mac_toQColor([NSColor disabledControlTextColor]); palette->setColor(QPalette::Disabled, QPalette::Text, qc); + palette->setColor(QPalette::Disabled, QPalette::ButtonText, qc); palette->setColor(QPalette::Disabled, QPalette::WindowText, qc); palette->setColor(QPalette::Disabled, QPalette::HighlightedText, qc); -- cgit v1.2.3