changeset 735:fda54e91ca05

Merge from branch background-mode
author Chris Cannam
date Fri, 24 Jan 2020 15:12:09 +0000
parents 16932dfaf64e (current diff) de7969894402 (diff)
children 4b58b8f44be7
files
diffstat 1 files changed, 16 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/framework/MainWindowBase.cpp	Wed Jan 15 14:00:18 2020 +0000
+++ b/framework/MainWindowBase.cpp	Fri Jan 24 15:12:09 2020 +0000
@@ -211,14 +211,28 @@
 
     SVDEBUG << "MainWindowBase: View font size is " << viewFontSize << endl;
 
-#ifdef NOT_DEFINED // This no longer works correctly on any platform AFAICS
+#ifndef Q_OS_MAC
+
     Preferences::BackgroundMode mode =
         Preferences::getInstance()->getBackgroundMode();
+
     m_initialDarkBackground = m_viewManager->getGlobalDarkBackground();
-    if (mode != Preferences::BackgroundFromTheme) {
+
+    if (OSReportsDarkThemeActive()) {
+        // NB !(OSReportsDarkThemeActive()) doesn't necessarily mean
+        // the theme is light - the function also cunningly returns
+        // false if it has no way to tell
+        m_initialDarkBackground = true;
+    }
+    
+    if (mode == Preferences::BackgroundFromTheme) {
+        m_viewManager->setGlobalDarkBackground
+            (m_initialDarkBackground);
+    } else {
         m_viewManager->setGlobalDarkBackground
             (mode == Preferences::DarkBackground);
     }
+    
 #endif
 
     m_paneStack = new PaneStack(nullptr, m_viewManager, paneStackOptions);