From efb74002c5da514eac31e0c11cefcdc02518db66 Mon Sep 17 00:00:00 2001 From: Yan Shapochnik Date: Thu, 21 Mar 2019 15:17:44 -0400 Subject: [PATCH] macOS: Use the correct text color for QPalette::ButtonText color role MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes the text color displayed in the QToolBar on macOS Mojave dark mode Change-Id: Ic4415295e314a8fc1c4fbb58964386e0563b8d44 Reviewed-by: Morten Johan Sørvig --- src/plugins/platforms/cocoa/qcocoasystemsettings.mm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/plugins/platforms/cocoa/qcocoasystemsettings.mm b/src/plugins/platforms/cocoa/qcocoasystemsettings.mm index aef2c6cf48..9b6dc94d33 100644 --- a/src/plugins/platforms/cocoa/qcocoasystemsettings.mm +++ b/src/plugins/platforms/cocoa/qcocoasystemsettings.mm @@ -158,10 +158,13 @@ QHash qt_mac_createRolePalettes() pal.setColor(QPalette::Inactive, QPalette::WindowText, qc); pal.setColor(QPalette::Active, QPalette::HighlightedText, qc); pal.setColor(QPalette::Inactive, QPalette::HighlightedText, qc); + pal.setColor(QPalette::Active, QPalette::ButtonText, qc); + pal.setColor(QPalette::Inactive, QPalette::ButtonText, qc); qc = qt_mac_toQColor(mac_widget_colors[i].inactive); pal.setColor(QPalette::Disabled, QPalette::Text, qc); pal.setColor(QPalette::Disabled, QPalette::WindowText, qc); pal.setColor(QPalette::Disabled, QPalette::HighlightedText, qc); + pal.setColor(QPalette::Disabled, QPalette::ButtonText, qc); } if (mac_widget_colors[i].paletteRole == QPlatformTheme::MenuPalette || mac_widget_colors[i].paletteRole == QPlatformTheme::MenuBarPalette) {