summaryrefslogtreecommitdiff
path: root/vcl/osx
diff options
context:
space:
mode:
authorThorsten Wagner <thorsten.wagner.4@gmail.com>2021-01-10 23:49:25 +0100
committerTor Lillqvist <tml@collabora.com>2021-01-17 19:21:15 +0100
commit1a167625314bf36b735176ed488e6ba9b5e9b675 (patch)
tree7864567fae32073aecbbac6fe70a9a2bbe31588b /vcl/osx
parent5bd90f7f5852056342f1a81a1285b474d468eadd (diff)
tdf#138122 Add window scaling for retina displays on macOS
(1) Remove hack to make application look as if being linked against SDK 10.13 (2) Use quad storage size on virtual devices for displaying on retina displays thereafter (3) Apply workaround to downsample bitmaps from scaled layers (to be implemented) (4) Disable dark mode (to be implemented) (5) Provide new environment variables: VCL_MACOS_FORCE_WINDOW_SCALING: window scaling on non retina displays VCL_MACOS_FORCE_DARK_MODE: enable dark mode (macOS 10.14, iOS 13 and newer) VCL_MACOS_USE_SYSTEM_APPEARANCE: use light mode or dark mode (macOS 10.14, iOS 13 and newer) as configured by system preferences Change-Id: I99877cd62a98cb91bcbf27af62b043c31c5f5fc9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109072 Tested-by: Jenkins Reviewed-by: Tor Lillqvist <tml@collabora.com>
Diffstat (limited to 'vcl/osx')
-rw-r--r--vcl/osx/salinst.cxx15
1 files changed, 15 insertions, 0 deletions
diff --git a/vcl/osx/salinst.cxx b/vcl/osx/salinst.cxx
index bbe6d9d704f7..1ab962284918 100644
--- a/vcl/osx/salinst.cxx
+++ b/vcl/osx/salinst.cxx
@@ -302,6 +302,21 @@ VCLPLUG_OSX_PUBLIC SalInstance* create_SalInstance()
// put cocoa into multithreaded mode
[NSThread detachNewThreadSelector:@selector(enableCocoaThreads:) toTarget:[[CocoaThreadEnabler alloc] init] withObject:nil];
+ // Dark mode is disabled as long as it is not implemented completely. For development purposes, it may be controlled by
+ // environment variables: VCL_MACOS_FORCE_DARK_MODE enable dark mode independent of system settings,
+ // VCL_MACOS_USE_SYSTEM_APPEARANCE to use system settings (light mode oder dark mode as configured within system preferences).
+
+ // 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, *))
+ [NSApp setAppearance: [NSAppearance appearanceNamed: NSAppearanceNameDarkAqua]];
+ }
+ else
+ if (!getenv("VCL_MACOS_USE_SYSTEM_APPEARANCE"))
+ [NSApp setAppearance: [NSAppearance appearanceNamed: NSAppearanceNameAqua]];
+
// activate our delegate methods
[NSApp setDelegate: NSApp];