From ecfe8e6e23a8136301036ed75116a4ce2dd4cab0 Mon Sep 17 00:00:00 2001 From: Timur Pocheptsov Date: Mon, 2 May 2022 08:12:13 +0200 Subject: [PATCH] Macstyle: fix the text color on the disabled button MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Forcing it to black make button look enabled, when it's not true. Baseline test already covers this scenario (but probably took wrong snapshot). Pick-to: 6.3 6.2 Fixes: QTBUG-102782 Change-Id: Ifa9041fbf5bf56a7a560e2d1af291c3db2b134f8 Reviewed-by: Tor Arne Vestbø --- src/plugins/styles/mac/qmacstyle_mac.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/styles/mac/qmacstyle_mac.mm b/src/plugins/styles/mac/qmacstyle_mac.mm index 3676a6ffb6..5e281b4e1d 100644 --- a/src/plugins/styles/mac/qmacstyle_mac.mm +++ b/src/plugins/styles/mac/qmacstyle_mac.mm @@ -3788,7 +3788,7 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter btn.palette.setColor(QPalette::ButtonText, Qt::white); } - if (!isDarkMode() && QOperatingSystemVersion::current() > QOperatingSystemVersion::MacOSBigSur) { + if (isEnabled && !isDarkMode() && QOperatingSystemVersion::current() > QOperatingSystemVersion::MacOSBigSur) { if (!isDefault && !(btn.state & State_On)) { // On macOS 12 it's a gray button, white text color (if set in the // previous statement) would be almost invisible.