summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2021-01-27 14:36:00 +0200
committerTor Lillqvist <tml@iki.fi>2021-01-27 18:52:29 +0200
commit841d27ff4cd6850c43bdd7333f8373cae686520d (patch)
treebe278be29928017243f77504d154bf8b45773148
parent2ca3dad5f5604890fa83ed8220cf7deeab26250e (diff)
NSApplication's appearance property exists in macOS 10.14 and later onlyprivate/tml/lov-7.0.4
Change-Id: I12f586d91e40da130f59eeba3ab65e07eec088d3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110013 Tested-by: Tor Lillqvist <tml@collabora.com> Reviewed-by: Tor Lillqvist <tml@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110015 Tested-by: Jenkins
-rw-r--r--vcl/osx/salinst.cxx12
1 files changed, 7 insertions, 5 deletions
diff --git a/vcl/osx/salinst.cxx b/vcl/osx/salinst.cxx
index e7f1a4304a31..c7314700bca0 100644
--- a/vcl/osx/salinst.cxx
+++ b/vcl/osx/salinst.cxx
@@ -320,14 +320,16 @@ VCLPLUG_OSX_PUBLIC SalInstance* create_SalInstance()
// TODO: After implementation of dark mode, this code has to be removed.
- if (getenv("VCL_MACOS_FORCE_DARK_MODE"))
+ if (@available(macOS 10.14, iOS 13, *))
{
- if (@available(macOS 10.14, iOS 13, *))
+ if (getenv("VCL_MACOS_FORCE_DARK_MODE"))
+ {
[NSApp setAppearance: [NSAppearance appearanceNamed: NSAppearanceNameDarkAqua]];
+ }
+ else
+ if (!getenv("VCL_MACOS_USE_SYSTEM_APPEARANCE"))
+ [NSApp setAppearance: [NSAppearance appearanceNamed: NSAppearanceNameAqua]];
}
- else
- if (!getenv("VCL_MACOS_USE_SYSTEM_APPEARANCE"))
- [NSApp setAppearance: [NSAppearance appearanceNamed: NSAppearanceNameAqua]];
// activate our delegate methods
[NSApp setDelegate: NSApp];