diff options
author | Tor Lillqvist <tml@collabora.com> | 2021-01-27 14:36:00 +0200 |
---|---|---|
committer | Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> | 2021-01-27 19:00:22 +0100 |
commit | 1f400d35d61076c460a28b2b83dddc9297f38140 (patch) | |
tree | e4fa500ccd01a870a5b6988c6a6f09412a9f3288 /vcl | |
parent | 17d27a27bc12b24ef48aef4722ab104b16eb50d2 (diff) |
NSApplication's appearance property exists in macOS 10.14 and later only
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
(cherry picked from commit 02bb41dd5197503d0d8b7d8be0a8cd220c0d1c85)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109988
Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/osx/salinst.cxx | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/vcl/osx/salinst.cxx b/vcl/osx/salinst.cxx index 87d81d2ac5d8..49b0b2af4e67 100644 --- a/vcl/osx/salinst.cxx +++ b/vcl/osx/salinst.cxx @@ -321,14 +321,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]; |