Changeset 107148 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Nov 26, 2024 2:00:36 PM (7 weeks ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox
- Files:
-
- 4 deleted
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk
r106945 r107148 875 875 src/settings/editors/UIBootOrderEditor.h \ 876 876 src/settings/editors/UIChipsetEditor.h \ 877 src/settings/editors/UIColorThemeEditor.h \878 877 src/settings/editors/UIDefaultMachineFolderEditor.h \ 879 878 src/settings/editors/UIDescriptionEditor.h \ … … 926 925 src/settings/global/UIGlobalSettingsLanguage.h \ 927 926 src/settings/global/UIGlobalSettingsDisplay.h \ 928 src/settings/global/UIGlobalSettingsInterface.h \929 927 src/settings/machine/UIMachineSettingsAudio.h \ 930 928 src/settings/machine/UIMachineSettingsDisplay.h \ … … 1460 1458 src/settings/editors/UIBootOrderEditor.cpp \ 1461 1459 src/settings/editors/UIChipsetEditor.cpp \ 1462 src/settings/editors/UIColorThemeEditor.cpp \1463 1460 src/settings/editors/UIDefaultMachineFolderEditor.cpp \ 1464 1461 src/settings/editors/UIDescriptionEditor.cpp \ … … 1511 1508 src/settings/global/UIGlobalSettingsLanguage.cpp \ 1512 1509 src/settings/global/UIGlobalSettingsDisplay.cpp \ 1513 src/settings/global/UIGlobalSettingsInterface.cpp \1514 1510 src/settings/machine/UIMachineSettingsAudio.cpp \ 1515 1511 src/settings/machine/UIMachineSettingsDisplay.cpp \ -
trunk/src/VBox/Frontends/VirtualBox/src/converter/UIConverterBackendGlobal.cpp
r106163 r107148 1629 1629 } 1630 1630 1631 /* QString <= UIColorThemeType: */1632 template<> SHARED_LIBRARY_STUFF QString UIConverter::toString(const UIColorThemeType &colorThemeType) const1633 {1634 QString strResult;1635 switch (colorThemeType)1636 {1637 case UIColorThemeType_Auto: strResult = QApplication::translate("UICommon", "Follow System Settings", "color theme"); break;1638 case UIColorThemeType_Light: strResult = QApplication::translate("UICommon", "Light", "color theme"); break;1639 case UIColorThemeType_Dark: strResult = QApplication::translate("UICommon", "Dark", "color theme"); break;1640 default:1641 {1642 AssertMsgFailed(("No text for color theme type=%d", colorThemeType));1643 break;1644 }1645 }1646 return strResult;1647 }1648 1649 /* QString <= UIColorThemeType: */1650 template<> SHARED_LIBRARY_STUFF QString UIConverter::toInternalString(const UIColorThemeType &colorThemeType) const1651 {1652 QString strResult;1653 switch (colorThemeType)1654 {1655 case UIColorThemeType_Auto: break;1656 case UIColorThemeType_Light: strResult = "Light"; break;1657 case UIColorThemeType_Dark: strResult = "Dark"; break;1658 default:1659 {1660 AssertMsgFailed(("No text for color theme type=%d", colorThemeType));1661 break;1662 }1663 }1664 return strResult;1665 }1666 1667 /* UIColorThemeType <= QString: */1668 template<> UIColorThemeType SHARED_LIBRARY_STUFF UIConverter::fromInternalString<UIColorThemeType>(const QString &strColorThemeType) const1669 {1670 if (strColorThemeType.compare("Light", Qt::CaseInsensitive) == 0)1671 return UIColorThemeType_Light;1672 if (strColorThemeType.compare("Dark", Qt::CaseInsensitive) == 0)1673 return UIColorThemeType_Dark;1674 return UIColorThemeType_Auto;1675 }1676 1677 1631 /* UILaunchMode <= QString: */ 1678 1632 template<> UILaunchMode SHARED_LIBRARY_STUFF UIConverter::fromInternalString<UILaunchMode>(const QString &strDefaultFrontendType) const … … 2111 2065 case GlobalSettingsPageType_Proxy: strResult = "Proxy"; break; 2112 2066 #endif /* VBOX_GUI_WITH_NETWORK_MANAGER */ 2113 case GlobalSettingsPageType_Interface: strResult = "Interface"; break;2114 2067 default: 2115 2068 { … … 2140 2093 return GlobalSettingsPageType_Proxy; 2141 2094 #endif /* VBOX_GUI_WITH_NETWORK_MANAGER */ 2142 if (strGlobalSettingsPageType.compare("Interface", Qt::CaseInsensitive) == 0)2143 return GlobalSettingsPageType_Interface;2144 2095 return GlobalSettingsPageType_Invalid; 2145 2096 } … … 2160 2111 case GlobalSettingsPageType_Proxy: return UIIconPool::pixmap(":/proxy_warning_16px.png"); 2161 2112 #endif /* VBOX_GUI_WITH_NETWORK_MANAGER */ 2162 case GlobalSettingsPageType_Interface: return UIIconPool::pixmap(":/interface_warning_16px.png");2163 2113 default: AssertMsgFailed(("No pixmap for %d", type)); break; 2164 2114 } -
trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataDefs.cpp
r106061 r107148 32 32 /* General: */ 33 33 const char *UIExtraDataDefs::GUI_RestrictedDialogs = "GUI/RestrictedDialogs"; 34 const char *UIExtraDataDefs::GUI_ColorTheme = "GUI/ColorTheme";35 34 36 35 -
trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataDefs.h
r106061 r107148 53 53 /** Holds restricted dialogs. */ 54 54 SHARED_LIBRARY_STUFF extern const char *GUI_RestrictedDialogs; 55 56 /** Holds the color theme type. */57 SHARED_LIBRARY_STUFF extern const char *GUI_ColorTheme;58 55 /** @} */ 59 56 … … 872 869 GlobalSettingsPageType_Proxy, 873 870 #endif 874 GlobalSettingsPageType_Interface,875 871 GlobalSettingsPageType_Max 876 872 }; … … 936 932 WizardMode_Expert 937 933 }; 938 939 940 /** Common UI: Color Theme types. */941 enum UIColorThemeType942 {943 UIColorThemeType_Auto,944 UIColorThemeType_Light,945 UIColorThemeType_Dark,946 };947 Q_DECLARE_METATYPE(UIColorThemeType);948 934 949 935 -
trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.cpp
r105363 r107148 2334 2334 } 2335 2335 2336 UIColorThemeType UIExtraDataManager::colorTheme()2337 {2338 return gpConverter->fromInternalString<UIColorThemeType>(extraDataString(GUI_ColorTheme));2339 }2340 2341 void UIExtraDataManager::setColorTheme(const UIColorThemeType &enmType)2342 {2343 setExtraDataString(GUI_ColorTheme, gpConverter->toInternalString(enmType));2344 }2345 2346 2336 QStringList UIExtraDataManager::suppressedMessages(const QUuid &uID /* = GlobalID */) 2347 2337 { -
trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.h
r106001 r107148 190 190 /** Defines a list of restricted dialogs. */ 191 191 void setRestrictedDialogTypes(UIExtraDataMetaDefs::DialogType enmTypes, const QUuid &uID); 192 193 /** Returns color theme type. */194 UIColorThemeType colorTheme();195 /** Defines color theme @a enmType. */196 void setColorTheme(const UIColorThemeType &enmType);197 192 /** @} */ 198 193 -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UICommon.cpp
r106349 r107148 817 817 bool UICommon::isWindowsInDarkMode() const 818 818 { 819 /* Load saved color theme: */ 820 UIColorThemeType enmColorTheme = gEDataManager->colorTheme(); 821 822 /* Check whether we have dark system theme requested: */ 823 if (enmColorTheme == UIColorThemeType_Auto) 824 { 825 QSettings settings("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize", 826 QSettings::NativeFormat); 827 if (settings.value("AppsUseLightTheme") == 0) 828 enmColorTheme = UIColorThemeType_Dark; 829 } 830 831 /* Return result: */ 832 return enmColorTheme == UIColorThemeType_Dark; 819 /* Check if Windows registry has no Light flag, that means system will use Dark mode: */ 820 QSettings settings("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize", 821 QSettings::NativeFormat); 822 return settings.value("AppsUseLightTheme") == 0; 833 823 } 834 824 … … 920 910 } 921 911 922 #elif defined(VBOX_WS_WIN) 923 924 /* For the Dark mode! */ 925 if (isInDarkMode()) 926 { 927 qApp->setStyle(QStyleFactory::create("Fusion")); 928 QPalette darkPalette; 929 QColor windowColor1 = QColor(59, 60, 61); 930 QColor windowColor2 = QColor(63, 64, 65); 931 QColor baseColor1 = QColor(46, 47, 48); 932 QColor baseColor2 = QColor(56, 57, 58); 933 QColor disabledColor = QColor(113, 114, 115); 934 darkPalette.setColor(QPalette::Window, windowColor1); 935 darkPalette.setColor(QPalette::WindowText, Qt::white); 936 darkPalette.setColor(QPalette::Disabled, QPalette::WindowText, disabledColor); 937 darkPalette.setColor(QPalette::Base, baseColor1); 938 darkPalette.setColor(QPalette::AlternateBase, baseColor2); 939 darkPalette.setColor(QPalette::PlaceholderText, disabledColor); 940 darkPalette.setColor(QPalette::Text, Qt::white); 941 darkPalette.setColor(QPalette::Disabled, QPalette::Text, disabledColor); 942 darkPalette.setColor(QPalette::Button, windowColor2); 943 darkPalette.setColor(QPalette::ButtonText, Qt::white); 944 darkPalette.setColor(QPalette::Disabled, QPalette::ButtonText, disabledColor); 945 darkPalette.setColor(QPalette::BrightText, Qt::red); 946 darkPalette.setColor(QPalette::Link, QColor(179, 214, 242)); 947 darkPalette.setColor(QPalette::Highlight, QColor(29, 84, 92)); 948 darkPalette.setColor(QPalette::HighlightedText, Qt::white); 949 darkPalette.setColor(QPalette::Disabled, QPalette::HighlightedText, disabledColor); 950 qApp->setPalette(darkPalette); 951 qApp->setStyleSheet("QToolTip { color: #ffffff; background-color: #2b2b2b; border: 1px solid #737373; }"); 952 } 953 954 #else /* Linux, BSD, Solaris */ 912 #elif defined(VBOX_WS_NIX) /* Linux, BSD, Solaris */ 955 913 956 914 /* For the Dark mode! */ -
trunk/src/VBox/Frontends/VirtualBox/src/settings/UIAdvancedSettingsDialogSpecific.cpp
r106061 r107148 47 47 #include "UIGlobalSettingsInput.h" 48 48 #include "UIGlobalSettingsLanguage.h" 49 #ifdef VBOX_WS_WIN50 # include "UIGlobalSettingsInterface.h"51 #endif52 49 #ifdef VBOX_GUI_WITH_NETWORK_MANAGER 53 50 # include "UIGlobalSettingsProxy.h" … … 113 110 #endif 114 111 115 #ifdef VBOX_WS_WIN116 /* Interface page: */117 m_pSelector->setItemText(GlobalSettingsPageType_Interface, tr("Interface"));118 #endif119 120 112 /* Polish the selector: */ 121 113 m_pSelector->polish(); … … 258 250 } 259 251 #endif /* VBOX_GUI_WITH_NETWORK_MANAGER */ 260 #ifdef VBOX_WS_WIN261 /* Interface page: */262 case GlobalSettingsPageType_Interface:263 {264 pSettingsPage = new UIGlobalSettingsInterface;265 addItem(":/interface_32px.png", ":/interface_24px.png", ":/interface_16px.png",266 iPageIndex, "#userInterface", pSettingsPage);267 addPageHelpKeyword(iPageIndex, "preferences");268 break;269 }270 #endif /* VBOX_WS_WIN */271 252 default: 272 253 break;
Note:
See TracChangeset
for help on using the changeset viewer.