VirtualBox

Changeset 89250 in vbox for trunk


Ignore:
Timestamp:
May 24, 2021 4:55:43 PM (4 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:10003: Reworking Details pane normal colors to be native; Hovered colors were removed.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/manager/details
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/details/UIDetailsElement.cpp

    r89102 r89250  
    8888    , m_pSet(pParent)
    8989    , m_enmType(enmType)
    90 #ifdef VBOX_WS_MAC
    91     , m_iDefaultToneStart(145)
    92     , m_iDefaultToneFinal(155)
    93     , m_iHoverToneStart(115)
    94     , m_iHoverToneFinal(125)
    95 #else
    96     , m_iDefaultToneStart(160)
    97     , m_iDefaultToneFinal(190)
    98     , m_iHoverToneStart(160)
    99     , m_iHoverToneFinal(190)
    100 #endif
     90    , m_iDefaultDarknessStart(100)
     91    , m_iDefaultDarknessFinal(105)
    10192    , m_fHovered(false)
    10293    , m_fNameHovered(false)
     
    10697    , m_iAnimationDuration(300)
    10798    , m_iDefaultValue(0)
    108     , m_iHoveredValue(255)
     99    , m_iHoveredValue(100)
    109100    , m_iAnimatedValue(m_iDefaultValue)
    110101    , m_pButton(0)
     
    14651456                         : optionRect;
    14661457
    1467     /* Acquire palette: */
    1468     const QPalette pal = QApplication::palette();
     1458    /* Acquire background color: */
     1459    QColor backgroundColor = QApplication::palette().color(QPalette::Active, QPalette::Window);
    14691460
    14701461    /* Paint default background: */
    1471     const QColor defaultColor = pal.color(QPalette::Active, QPalette::Mid);
    1472     const QColor dcTone1 = defaultColor.lighter(m_iDefaultToneFinal);
    1473     const QColor dcTone2 = defaultColor.lighter(m_iDefaultToneStart);
    1474     QLinearGradient gradientDefault(fullRect.topLeft(), fullRect.bottomLeft());
    1475     gradientDefault.setColorAt(0, dcTone1);
    1476     gradientDefault.setColorAt(1, dcTone2);
     1462    QLinearGradient gradientDefault(fullRect.topLeft(), fullRect.bottomRight());
     1463    gradientDefault.setColorAt(0, backgroundColor.darker(m_iDefaultDarknessStart));
     1464    gradientDefault.setColorAt(1, backgroundColor.darker(m_iDefaultDarknessFinal));
    14771465    pPainter->fillRect(fullRect, gradientDefault);
    14781466
    14791467    /* If element is hovered: */
    1480     if (m_fHovered)
    1481     {
     1468    if (animatedValue())
     1469    {
     1470        /* Acquire header color: */
     1471        QColor headColor = backgroundColor.lighter(130);
     1472
    14821473        /* Paint hovered background: */
    1483         const QColor hoveredColor = pal.color(QPalette::Active, QPalette::Highlight);
    1484         QColor hcTone1 = hoveredColor.lighter(m_iHoverToneFinal);
    1485         QColor hcTone2 = hoveredColor.lighter(m_iHoverToneStart);
    1486         hcTone1.setAlpha(m_iAnimatedValue);
    1487         hcTone2.setAlpha(m_iAnimatedValue);
     1474        QColor hcTone1 = headColor;
     1475        QColor hcTone2 = headColor;
     1476        hcTone1.setAlpha(255 * animatedValue() / 100);
     1477        hcTone2.setAlpha(0);
    14881478        QLinearGradient gradientHovered(headRect.topLeft(), headRect.bottomLeft());
    14891479        gradientHovered.setColorAt(0, hcTone1);
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/details/UIDetailsElement.h

    r89101 r89250  
    351351        QFont  m_textFont;
    352352
    353         /** Holds the start default tone. */
    354         int m_iDefaultToneStart;
    355         /** Holds the final default tone. */
    356         int m_iDefaultToneFinal;
    357         /** Holds the start hover tone. */
    358         int m_iHoverToneStart;
    359         /** Holds the final hover tone. */
    360         int m_iHoverToneFinal;
     353        /** Holds the start default darkness. */
     354        int m_iDefaultDarknessStart;
     355        /** Holds the final default darkness. */
     356        int m_iDefaultDarknessFinal;
    361357
    362358        /** Holds whether element is hovered. */
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