Changeset 102524 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Dec 7, 2023 3:04:57 PM (14 months ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/globals
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/globals/UICommon.cpp
r102518 r102524 1009 1009 } 1010 1010 1011 #ifdef VBOX_WS_WIN 1012 bool UICommon::isWindowsInDarkMode() const 1013 { 1014 /* Load saved color theme: */ 1015 UIColorThemeType enmColorTheme = gEDataManager->colorTheme(); 1016 1017 /* Check whether we have dark system theme requested: */ 1018 if (enmColorTheme == UIColorThemeType_Auto) 1019 { 1020 QSettings settings("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize", 1021 QSettings::NativeFormat); 1022 if (settings.value("AppsUseLightTheme") == 0) 1023 enmColorTheme = UIColorThemeType_Dark; 1024 } 1025 1026 /* Return result: */ 1027 return enmColorTheme == UIColorThemeType_Dark; 1028 } 1029 #endif /* VBOX_WS_WIN */ 1030 1011 1031 void UICommon::loadColorTheme() 1012 1032 { … … 1074 1094 #elif defined(VBOX_WS_WIN) 1075 1095 1076 /* Load saved color theme: */ 1077 UIColorThemeType enmColorTheme = gEDataManager->colorTheme(); 1078 1079 /* Check whether we have dark system theme requested: */ 1080 if (enmColorTheme == UIColorThemeType_Auto) 1081 { 1082 QSettings settings("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize", 1083 QSettings::NativeFormat); 1084 if (settings.value("AppsUseLightTheme") == 0) 1085 enmColorTheme = UIColorThemeType_Dark; 1086 } 1087 1088 /* Check whether dark theme was requested by any means: */ 1089 if (enmColorTheme == UIColorThemeType_Dark) 1096 /* For the Dark mode! */ 1097 if (isWindowsInDarkMode()) 1090 1098 { 1091 1099 qApp->setStyle(QStyleFactory::create("Fusion")); -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UICommon.h
r102518 r102524 236 236 QString hostOperatingSystem() const; 237 237 238 #ifdef VBOX_WS_WIN 239 /** Returns whether Windows host is in Dark mode. */ 240 bool isWindowsInDarkMode() const; 241 #endif 242 238 243 /** Loads the color theme. */ 239 244 void loadColorTheme();
Note:
See TracChangeset
for help on using the changeset viewer.