diff options
author | Morten Johan Sørvig <morten.sorvig@qt.io> | 2018-10-17 11:42:22 +0200 |
---|---|---|
committer | Morten Johan Sørvig <morten.sorvig@qt.io> | 2018-10-18 20:31:24 +0000 |
commit | b88eaa255a4646446e0842f3d8f732b39d09a65f (patch) | |
tree | e586b17d94aa24c5f669b2c70559e9c74fbb719f /src/plugins/platforms/cocoa/qcocoasystemsettings.mm | |
parent | 94a829689efdd33562e2aeb78e8a408b5c1c10a8 (diff) |
macOS: Use correct text background color
Commit 582d221b29bbf introduced a regression where
the default Base color is no longer white in light mode,
for some use cases like querying QApplication::palette()
and when using style sheets.
[NSColor windowBackgroundColor] is not the correct
color for QPalette:Base, [NSColor textBackgroundColor]
is, except for the Disabled state which uses windowBackgroundColor
to get a grayed-out look.
This also changes the dark mode Base color slightly, from
RGB(0.196, 0.196, 0.196) to RGB(0.118, 0.118, 0.118).
Task-number: QTBUG-70966
Change-Id: I1ff494a09980ff2d04b2e2c43ee0bcc8e26ba9e7
Fixes: QTBUG-70966
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Diffstat (limited to 'src/plugins/platforms/cocoa/qcocoasystemsettings.mm')
-rw-r--r-- | src/plugins/platforms/cocoa/qcocoasystemsettings.mm | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoasystemsettings.mm b/src/plugins/platforms/cocoa/qcocoasystemsettings.mm index 672b0e4f25..aef2c6cf48 100644 --- a/src/plugins/platforms/cocoa/qcocoasystemsettings.mm +++ b/src/plugins/platforms/cocoa/qcocoasystemsettings.mm @@ -75,8 +75,9 @@ QPalette * qt_mac_createSystemPalette() palette->setBrush(QPalette::Disabled, QPalette::Text, dark); palette->setBrush(QPalette::Disabled, QPalette::ButtonText, dark); palette->setBrush(QPalette::Disabled, QPalette::Base, backgroundBrush); - palette->setBrush(QPalette::Active, QPalette::Base, backgroundBrush); - palette->setBrush(QPalette::Inactive, QPalette::Base, backgroundBrush); + QBrush textBackgroundBrush = qt_mac_toQBrush([NSColor textBackgroundColor]); + palette->setBrush(QPalette::Active, QPalette::Base, textBackgroundBrush); + palette->setBrush(QPalette::Inactive, QPalette::Base, textBackgroundBrush); palette->setColor(QPalette::Disabled, QPalette::Dark, QColor(191, 191, 191)); palette->setColor(QPalette::Active, QPalette::Dark, QColor(191, 191, 191)); palette->setColor(QPalette::Inactive, QPalette::Dark, QColor(191, 191, 191)); |