From 48bd5646394f14dcef8a5ac9c334a840dad8cdd9 Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Tue, 23 Feb 2021 13:34:24 -0800 Subject: [PATCH] Add Dark mode detection to MacOS --- libs/kiplatform/osx/ui.mm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/kiplatform/osx/ui.mm b/libs/kiplatform/osx/ui.mm index 3ce864940f..f4f48a8a1f 100644 --- a/libs/kiplatform/osx/ui.mm +++ b/libs/kiplatform/osx/ui.mm @@ -30,8 +30,8 @@ bool KIPLATFORM::UI::IsDarkTheme() { - // TODO(ISM): Write this function - return false; + NSString *appearanceName = [[NSAppearance currentAppearance] name]; + return !![appearanceName containsString:@"Dark"]; }