diff options
author | Caolán McNamara <caolanm@redhat.com> | 2023-02-08 17:07:07 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2023-02-08 19:27:10 +0000 |
commit | b9399259b2cc612e38b178667e08d444a7e2fc1e (patch) | |
tree | 4d9cc536143900e0dd7533e43e7ba53a0a83b886 | |
parent | 102e15d6f3960b0ea357b89243b6fe85df34bfec (diff) |
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 <caolanm@redhat.com>
-rw-r--r-- | vcl/osx/salframe.cxx | 8 |
1 files changed, 4 insertions, 4 deletions
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 |