vcl/osx/salframe.cxx | 8 ++++---- vcl/source/control/button.cxx | 2 -- 2 files changed, 4 insertions(+), 6 deletions(-)
New commits: commit b9399259b2cc612e38b178667e08d444a7e2fc1e Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Wed Feb 8 17:07:07 2023 +0000 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Wed Feb 8 19:27:10 2023 +0000 tdf#153229 use bestMatchFromAppearancesWithNames to take user pref into account so user's override of system is taken into account for the icon theme. Change-Id: I02a9bf67eb6a3406f0e60bea58387e2e7457c995 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146669 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caol...@redhat.com> diff --git a/vcl/osx/salframe.cxx b/vcl/osx/salframe.cxx index 62eb7bbac341..dd3b9fa1d411 100644 --- a/vcl/osx/salframe.cxx +++ b/vcl/osx/salframe.cxx @@ -1309,11 +1309,11 @@ SAL_WNODEPRECATED_DECLARATIONS_POP StyleSettings aStyleSettings = rSettings.GetStyleSettings(); bool bUseDarkMode(false); - NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults]; - if (userDefaults != nil) + if (@available(macOS 10.14, iOS 13, *)) { - NSString* setting = [userDefaults stringForKey: @"AppleInterfaceStyle"]; - bUseDarkMode = (setting && [setting isEqual: @"Dark"]); + NSAppearanceName match = [mpNSView.effectiveAppearance bestMatchFromAppearancesWithNames: @[ + NSAppearanceNameAqua, NSAppearanceNameDarkAqua]]; + bUseDarkMode = [match isEqualToString: NSAppearanceNameDarkAqua]; } // there is no sukapura_dark, at the time of writing at least, so whatever // is considered the default dark icon set will be used commit 102e15d6f3960b0ea357b89243b6fe85df34bfec Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Wed Feb 8 16:37:33 2023 +0000 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Wed Feb 8 19:26:57 2023 +0000 Related: tdf#152486 infobar is white text on light button in light mode background isn't "bright" or "dark" enough to be considered one or the other. This is only used for the infobars, so black text is good enough for the current bg colors in use. Change-Id: I4c2c4fadac72cc35aebeadec417186c6358c0a77 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146667 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caol...@redhat.com> diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx index 46d7b5123d82..98dc12397361 100644 --- a/vcl/source/control/button.cxx +++ b/vcl/source/control/button.cxx @@ -908,8 +908,6 @@ void PushButton::ImplDrawPushButtonContent(OutputDevice *pDev, SystemTextColorFl { if (aColor.IsBright() && !pParent->GetControlBackground().IsDark()) aColor = COL_BLACK; - else if (aColor.IsDark() && !pParent->GetControlBackground().IsBright()) - aColor = COL_WHITE; } } #endif