Changeset 102525 in vbox
- Timestamp:
- Dec 7, 2023 3:17:24 PM (15 months ago)
- svn:sync-xref-src-repo-rev:
- 160669
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/globals
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/globals/UICommon.cpp
r102524 r102525 193 193 #ifdef VBOX_WS_MAC 194 194 , m_enmMacOSVersion(MacOSXRelease_Old) 195 , m_fDarkMode(false)196 195 #endif 197 196 #ifdef VBOX_WS_NIX … … 200 199 , m_enmDisplayServerType(VBGHDISPLAYSERVERTYPE_NONE) 201 200 #endif 201 , m_fDarkMode(false) 202 202 , m_fSeparateProcess(false) 203 203 , m_fShowStartVMErrors(true) … … 322 322 m_pThreadPoolCloud = new UIThreadPool(2 /* worker count */, 1000 /* worker timeout */); 323 323 324 #ifdef VBOX_WS_MAC 325 /* Load whether macOS is in Dark mode: */ 324 /* Load whether host OS is in Dark mode: */ 325 #if defined(VBOX_WS_MAC) 326 326 m_fDarkMode = UICocoaApplication::instance()->isDarkMode(); 327 #elif defined(VBOX_WS_WIN) 328 m_fDarkMode = isWindowsInDarkMode(); 327 329 #endif 328 330 /* Load color theme: */ … … 1095 1097 1096 1098 /* For the Dark mode! */ 1097 if (is WindowsInDarkMode())1099 if (isInDarkMode()) 1098 1100 { 1099 1101 qApp->setStyle(QStyleFactory::create("Fusion")); … … 2858 2860 } 2859 2861 2860 #if def VBOX_WS_MAC2862 #if defined(VBOX_WS_MAC) || defined(VBOX_WS_WIN) 2861 2863 /* Handle application palette change event: */ 2862 2864 if ( pEvent->type() == QEvent::ApplicationPaletteChange 2863 2865 && pObject == windowManager().mainWindowShown()) 2864 2866 { 2867 # if defined(VBOX_WS_MAC) 2865 2868 const bool fDarkMode = UICocoaApplication::instance()->isDarkMode(); 2869 # elif defined(VBOX_WS_WIN) 2870 const bool fDarkMode = isWindowsInDarkMode(); 2871 # endif 2866 2872 if (m_fDarkMode != fDarkMode) 2867 2873 { … … 2871 2877 } 2872 2878 } 2873 #endif 2879 #endif /* VBOX_WS_MAC || VBOX_WS_WIN */ 2874 2880 2875 2881 /* Call to base-class: */ -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UICommon.h
r102524 r102525 218 218 /** macOS: Returns #MacOSXRelease determined during UICommon prepare routine. */ 219 219 MacOSXRelease osRelease() const { return m_enmMacOSVersion; } 220 221 /** macOS: Returns whether macOS is in Dark mode. */222 bool isInDarkMode() const { return m_fDarkMode; }223 220 #endif 224 221 … … 240 237 bool isWindowsInDarkMode() const; 241 238 #endif 239 240 /** Returns whether host OS is in Dark mode. */ 241 bool isInDarkMode() const { return m_fDarkMode; } 242 242 243 243 /** Loads the color theme. */ … … 670 670 /** macOS: Holds the #MacOSXRelease determined using <i>uname</i> call. */ 671 671 MacOSXRelease m_enmMacOSVersion; 672 673 /** macOS: Holds whether macOS is in Dark mode. */674 bool m_fDarkMode;675 672 #endif 676 673 … … 683 680 VBGHDISPLAYSERVERTYPE m_enmDisplayServerType; 684 681 #endif 682 683 /** Holds whether host OS is in Dark mode. */ 684 bool m_fDarkMode; 685 685 /** @} */ 686 686
Note:
See TracChangeset
for help on using the changeset viewer.