[Libreoffice-commits] core.git: Branch 'libreoffice-7-1' - vcl/osx

Thorsten Wagner (via logerrit) logerrit at kemper.freedesktop.org
Mon Jan 18 07:06:39 UTC 2021


 vcl/osx/salframe.cxx |   32 +++++++++++++++++++++-----------
 1 file changed, 21 insertions(+), 11 deletions(-)

New commits:
commit 1cf7ce5a57e50a734258b83a3919a59aa535241f
Author:     Thorsten Wagner <thorsten.wagner.4 at gmail.com>
AuthorDate: Sun Jan 17 20:24:26 2021 +0100
Commit:     Adolfo Jayme Barrientos <fitojb at ubuntu.com>
CommitDate: Mon Jan 18 08:06:03 2021 +0100

    tdf#138314 Change selected tab text color on macOS Big Sur
    
    Starting with macOS Big Sur, coloring has changed. Currently there is
    no documentation which system color should be used for selected tab
    text. As a workaround text color is changed for macOS Big Sur and
    newer only.
    
    Change-Id: I2e8c83527775c17f95e5e4afe70577442e14715e
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109479
    Tested-by: Tor Lillqvist <tml at collabora.com>
    Reviewed-by: Tor Lillqvist <tml at collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109502
    Tested-by: Jenkins
    Reviewed-by: Adolfo Jayme Barrientos <fitojb at ubuntu.com>

diff --git a/vcl/osx/salframe.cxx b/vcl/osx/salframe.cxx
index b4168a2142e7..9d4f68827a06 100644
--- a/vcl/osx/salframe.cxx
+++ b/vcl/osx/salframe.cxx
@@ -1302,27 +1302,37 @@ SAL_WNODEPRECATED_DECLARATIONS_POP
     // black otherwise
 
     Color aControlTextColor(getColor([NSColor controlTextColor], COL_BLACK, mpNSWindow));
-    Color aSelectedControlTextColor(getColor([NSColor alternateSelectedControlTextColor], COL_WHITE, mpNSWindow));
-    aStyleSettings.SetDefaultButtonTextColor(aSelectedControlTextColor);
+    Color aSelectedControlTextColor(getColor([NSColor selectedControlTextColor], COL_BLACK, mpNSWindow));
+    Color aAlternateSelectedControlTextColor(getColor([NSColor alternateSelectedControlTextColor], COL_WHITE, mpNSWindow));
+    aStyleSettings.SetDefaultButtonTextColor(aAlternateSelectedControlTextColor);
     aStyleSettings.SetButtonTextColor(aControlTextColor);
-    aStyleSettings.SetDefaultActionButtonTextColor(aSelectedControlTextColor);
+    aStyleSettings.SetDefaultActionButtonTextColor(aAlternateSelectedControlTextColor);
     aStyleSettings.SetActionButtonTextColor(aControlTextColor);
     aStyleSettings.SetFlatButtonTextColor(aControlTextColor);
-    aStyleSettings.SetDefaultButtonRolloverTextColor(aSelectedControlTextColor);
+    aStyleSettings.SetDefaultButtonRolloverTextColor(aAlternateSelectedControlTextColor);
     aStyleSettings.SetButtonRolloverTextColor(aControlTextColor);
-    aStyleSettings.SetDefaultActionButtonRolloverTextColor(aSelectedControlTextColor);
+    aStyleSettings.SetDefaultActionButtonRolloverTextColor(aAlternateSelectedControlTextColor);
     aStyleSettings.SetActionButtonRolloverTextColor(aControlTextColor);
     aStyleSettings.SetFlatButtonRolloverTextColor(aControlTextColor);
-    aStyleSettings.SetDefaultButtonPressedRolloverTextColor(aSelectedControlTextColor);
-    aStyleSettings.SetButtonPressedRolloverTextColor(aSelectedControlTextColor);
-    aStyleSettings.SetDefaultActionButtonPressedRolloverTextColor(aSelectedControlTextColor);
-    aStyleSettings.SetActionButtonPressedRolloverTextColor(aSelectedControlTextColor);
+    aStyleSettings.SetDefaultButtonPressedRolloverTextColor(aAlternateSelectedControlTextColor);
+    aStyleSettings.SetButtonPressedRolloverTextColor(aAlternateSelectedControlTextColor);
+    aStyleSettings.SetDefaultActionButtonPressedRolloverTextColor(aAlternateSelectedControlTextColor);
+    aStyleSettings.SetActionButtonPressedRolloverTextColor(aAlternateSelectedControlTextColor);
     aStyleSettings.SetFlatButtonPressedRolloverTextColor(aControlTextColor);
 
-    // Set text colors for tabs according to OS settings, typically white for selected buttons, black otherwise
+    // Set text colors for tabs according to OS settings
 
     aStyleSettings.SetTabTextColor(aControlTextColor);
-    aStyleSettings.SetTabHighlightTextColor(aSelectedControlTextColor);
+
+    // FIXME: Starting with macOS Big Sur, coloring has changed. Currently there is no documentation which system color should be
+    // used for selected tab text. As a workaround the current OS version has to be considered. This code has to be reviewed once
+    // issue is covered by documentation.
+
+    NSOperatingSystemVersion aOSVersion = { .majorVersion = 11, .minorVersion = 0, .patchVersion = 0 };
+    if ([NSProcessInfo.processInfo isOperatingSystemAtLeastVersion: aOSVersion])
+        aStyleSettings.SetTabHighlightTextColor(aSelectedControlTextColor);
+    else
+        aStyleSettings.SetTabHighlightTextColor(aAlternateSelectedControlTextColor);
 
     aStyleSettings.SetCursorBlinkTime( mnBlinkCursorDelay );
 


More information about the Libreoffice-commits mailing list