diff options
author | Andrew Hyatt <andrewrhyatt@icloud.com> | 2019-05-02 14:33:12 -0400 |
---|---|---|
committer | Tor Lillqvist <tml@collabora.com> | 2019-05-03 12:14:36 +0200 |
commit | 89775fd396e413daaf0e71710211075450bdc0ed (patch) | |
tree | 9fe17610e0a4e96e627e4aa3c97fd8ee1b4956f9 | |
parent | b69bc0facc6e0fbc2006125e656b82a7c2556203 (diff) |
tdf#125088 Make button text white for blue buttons on macOS
Change-Id: I6479b8b1544c5aa8a582854f4db4b4c4c01c28ed
Reviewed-on: https://gerrit.libreoffice.org/71710
Tested-by: Julien Nabet <serval2412@yahoo.fr>
Reviewed-by: Tor Lillqvist <tml@collabora.com>
Tested-by: Tor Lillqvist <tml@collabora.com>
-rw-r--r-- | vcl/source/control/button.cxx | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx index 93aed205fdcb..5ab14d2c2db2 100644 --- a/vcl/source/control/button.cxx +++ b/vcl/source/control/button.cxx @@ -812,6 +812,16 @@ void PushButton::ImplDrawPushButtonContent(OutputDevice* pDev, DrawFlags nDrawFl if ( nDrawFlags & DrawFlags::Mono ) aColor = COL_BLACK; +#ifdef MACOSX + else if ((nButtonFlags & DrawButtonFlags::Default) && !(GetStyle() & WB_FLATBUTTON)) + { + // Make text color white if the button is a default control on macOS. + // Without this you get a button with a blue background and blue text + // which stands out as not looking right on macOS where default buttons + // have white text and a blue background. + aColor = COL_WHITE; + } +#endif else if( (nButtonFlags & DrawButtonFlags::Highlight) && IsNativeControlSupported(ControlType::Pushbutton, ControlPart::Entire) ) { if (nButtonFlags & DrawButtonFlags::Pressed) |