VirtualBox

Changeset 107148 in vbox for trunk/src/VBox/Frontends


Ignore:
Timestamp:
Nov 26, 2024 2:00:36 PM (7 weeks ago)
Author:
vboxsync
Message:

FE/Qt: bugref:10807: Windows: Wiping out all the code related to Global Interface page and Color Theme editor; That effectively enables new Windows Dark color theme of Qt 6.8.

Location:
trunk/src/VBox/Frontends/VirtualBox
Files:
4 deleted
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk

    r106945 r107148  
    875875        src/settings/editors/UIBootOrderEditor.h \
    876876        src/settings/editors/UIChipsetEditor.h \
    877         src/settings/editors/UIColorThemeEditor.h \
    878877        src/settings/editors/UIDefaultMachineFolderEditor.h \
    879878        src/settings/editors/UIDescriptionEditor.h \
     
    926925        src/settings/global/UIGlobalSettingsLanguage.h \
    927926        src/settings/global/UIGlobalSettingsDisplay.h \
    928         src/settings/global/UIGlobalSettingsInterface.h \
    929927        src/settings/machine/UIMachineSettingsAudio.h \
    930928        src/settings/machine/UIMachineSettingsDisplay.h \
     
    14601458        src/settings/editors/UIBootOrderEditor.cpp \
    14611459        src/settings/editors/UIChipsetEditor.cpp \
    1462         src/settings/editors/UIColorThemeEditor.cpp \
    14631460        src/settings/editors/UIDefaultMachineFolderEditor.cpp \
    14641461        src/settings/editors/UIDescriptionEditor.cpp \
     
    15111508        src/settings/global/UIGlobalSettingsLanguage.cpp \
    15121509        src/settings/global/UIGlobalSettingsDisplay.cpp \
    1513         src/settings/global/UIGlobalSettingsInterface.cpp \
    15141510        src/settings/machine/UIMachineSettingsAudio.cpp \
    15151511        src/settings/machine/UIMachineSettingsDisplay.cpp \
  • trunk/src/VBox/Frontends/VirtualBox/src/converter/UIConverterBackendGlobal.cpp

    r106163 r107148  
    16291629}
    16301630
    1631 /* QString <= UIColorThemeType: */
    1632 template<> SHARED_LIBRARY_STUFF QString UIConverter::toString(const UIColorThemeType &colorThemeType) const
    1633 {
    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) const
    1651 {
    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) const
    1669 {
    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 
    16771631/* UILaunchMode <= QString: */
    16781632template<> UILaunchMode SHARED_LIBRARY_STUFF UIConverter::fromInternalString<UILaunchMode>(const QString &strDefaultFrontendType) const
     
    21112065        case GlobalSettingsPageType_Proxy:      strResult = "Proxy"; break;
    21122066#endif /* VBOX_GUI_WITH_NETWORK_MANAGER */
    2113         case GlobalSettingsPageType_Interface:  strResult = "Interface"; break;
    21142067        default:
    21152068        {
     
    21402093        return GlobalSettingsPageType_Proxy;
    21412094#endif /* VBOX_GUI_WITH_NETWORK_MANAGER */
    2142     if (strGlobalSettingsPageType.compare("Interface", Qt::CaseInsensitive) == 0)
    2143         return GlobalSettingsPageType_Interface;
    21442095    return GlobalSettingsPageType_Invalid;
    21452096}
     
    21602111        case GlobalSettingsPageType_Proxy:      return UIIconPool::pixmap(":/proxy_warning_16px.png");
    21612112#endif /* VBOX_GUI_WITH_NETWORK_MANAGER */
    2162         case GlobalSettingsPageType_Interface:  return UIIconPool::pixmap(":/interface_warning_16px.png");
    21632113        default: AssertMsgFailed(("No pixmap for %d", type)); break;
    21642114    }
  • trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataDefs.cpp

    r106061 r107148  
    3232/* General: */
    3333const char *UIExtraDataDefs::GUI_RestrictedDialogs = "GUI/RestrictedDialogs";
    34 const char *UIExtraDataDefs::GUI_ColorTheme = "GUI/ColorTheme";
    3534
    3635
  • trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataDefs.h

    r106061 r107148  
    5353        /** Holds restricted dialogs. */
    5454        SHARED_LIBRARY_STUFF extern const char *GUI_RestrictedDialogs;
    55 
    56         /** Holds the color theme type. */
    57         SHARED_LIBRARY_STUFF extern const char *GUI_ColorTheme;
    5855    /** @} */
    5956
     
    872869    GlobalSettingsPageType_Proxy,
    873870#endif
    874     GlobalSettingsPageType_Interface,
    875871    GlobalSettingsPageType_Max
    876872};
     
    936932    WizardMode_Expert
    937933};
    938 
    939 
    940 /** Common UI: Color Theme types. */
    941 enum UIColorThemeType
    942 {
    943     UIColorThemeType_Auto,
    944     UIColorThemeType_Light,
    945     UIColorThemeType_Dark,
    946 };
    947 Q_DECLARE_METATYPE(UIColorThemeType);
    948934
    949935
  • trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.cpp

    r105363 r107148  
    23342334}
    23352335
    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 
    23462336QStringList UIExtraDataManager::suppressedMessages(const QUuid &uID /* = GlobalID */)
    23472337{
  • trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.h

    r106001 r107148  
    190190        /** Defines a list of restricted dialogs. */
    191191        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);
    197192    /** @} */
    198193
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UICommon.cpp

    r106349 r107148  
    817817bool UICommon::isWindowsInDarkMode() const
    818818{
    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;
    833823}
    834824
     
    920910    }
    921911
    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 */
    955913
    956914    /* For the Dark mode! */
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/UIAdvancedSettingsDialogSpecific.cpp

    r106061 r107148  
    4747#include "UIGlobalSettingsInput.h"
    4848#include "UIGlobalSettingsLanguage.h"
    49 #ifdef VBOX_WS_WIN
    50 # include "UIGlobalSettingsInterface.h"
    51 #endif
    5249#ifdef VBOX_GUI_WITH_NETWORK_MANAGER
    5350# include "UIGlobalSettingsProxy.h"
     
    113110#endif
    114111
    115 #ifdef VBOX_WS_WIN
    116     /* Interface page: */
    117     m_pSelector->setItemText(GlobalSettingsPageType_Interface, tr("Interface"));
    118 #endif
    119 
    120112    /* Polish the selector: */
    121113    m_pSelector->polish();
     
    258250                }
    259251#endif /* VBOX_GUI_WITH_NETWORK_MANAGER */
    260 #ifdef VBOX_WS_WIN
    261                 /* 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 */
    271252                default:
    272253                    break;
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette