VirtualBox

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


Ignore:
Timestamp:
May 24, 2021 3:39:33 PM (4 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:10003: A bit of cleanup for Tool pane color tones; Renaming and refactoring only, no actual color changes.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/tools/UIToolsItem.cpp

    r89242 r89243  
    189189    , m_iHoveredValue(100)
    190190    , m_iAnimatedValue(m_iDefaultValue)
    191     , m_iDefaultLightnessMin(0)
    192     , m_iDefaultLightnessMax(0)
    193     , m_iHoverLightnessMin(0)
    194     , m_iHoverLightnessMax(0)
    195     , m_iHighlightLightnessMin(0)
    196     , m_iHighlightLightnessMax(0)
     191    , m_iDefaultLightnessStart(0)
     192    , m_iDefaultLightnessFinal(0)
     193    , m_iHoverLightnessStart(0)
     194    , m_iHoverLightnessFinal(0)
     195    , m_iHighlightLightnessStart(0)
     196    , m_iHighlightLightnessFinal(0)
    197197    , m_iPreviousMinimumWidthHint(0)
    198198    , m_iPreviousMinimumHeightHint(0)
     
    443443    /* Prepare color tones: */
    444444#ifdef VBOX_WS_MAC
    445     m_iHighlightLightnessMin = 105;
    446     m_iHighlightLightnessMax = 115;
    447     m_iHoverLightnessMin = 115;
    448     m_iHoverLightnessMax = 125;
    449     m_iDefaultLightnessMin = 145;
    450     m_iDefaultLightnessMax = 155;
     445    m_iDefaultLightnessStart = 105;
     446    m_iDefaultLightnessFinal = 115;
     447    m_iHoverLightnessStart = 115;
     448    m_iHoverLightnessFinal = 125;
     449    m_iHighlightLightnessStart = 145;
     450    m_iHighlightLightnessFinal = 155;
    451451#else /* VBOX_WS_MAC */
    452     m_iHighlightLightnessMin = 130;
    453     m_iHighlightLightnessMax = 160;
    454     m_iHoverLightnessMin = 160;
    455     m_iHoverLightnessMax = 190;
    456     m_iDefaultLightnessMin = 160;
    457     m_iDefaultLightnessMax = 190;
     452    m_iHighlightLightnessStart = 130;
     453    m_iHighlightLightnessFinal = 160;
     454    m_iHoverLightnessStart = 160;
     455    m_iHoverLightnessFinal = 190;
     456    m_iDefaultLightnessStart = 160;
     457    m_iDefaultLightnessFinal = 190;
    458458#endif /* !VBOX_WS_MAC */
    459459
     
    720720        /* Draw gradient: */
    721721        QLinearGradient bgGrad(rectangle.topLeft(), rectangle.bottomLeft());
    722         bgGrad.setColorAt(0, backgroundColor.lighter(m_iHighlightLightnessMax));
    723         bgGrad.setColorAt(1, backgroundColor.lighter(m_iHighlightLightnessMin));
     722        bgGrad.setColorAt(0, backgroundColor.lighter(m_iHighlightLightnessFinal));
     723        bgGrad.setColorAt(1, backgroundColor.lighter(m_iHighlightLightnessStart));
    724724        pPainter->fillRect(rectangle, bgGrad);
    725725
     
    759759        /* Draw gradient: */
    760760        QLinearGradient bgGrad(rectangle.topLeft(), rectangle.bottomLeft());
    761         bgGrad.setColorAt(0, backgroundColor.lighter(m_iHoverLightnessMax));
    762         bgGrad.setColorAt(1, backgroundColor.lighter(m_iHoverLightnessMin));
     761        bgGrad.setColorAt(0, backgroundColor.lighter(m_iHoverLightnessFinal));
     762        bgGrad.setColorAt(1, backgroundColor.lighter(m_iHoverLightnessStart));
    763763        pPainter->fillRect(rectangle, bgGrad);
    764764
     
    798798        /* Draw gradient: */
    799799        QLinearGradient bgGrad(rectangle.topLeft(), rectangle.bottomLeft());
    800         bgGrad.setColorAt(0, backgroundColor.lighter(m_iDefaultLightnessMax));
    801         bgGrad.setColorAt(1, backgroundColor.lighter(m_iDefaultLightnessMin));
     800        bgGrad.setColorAt(0, backgroundColor.lighter(m_iDefaultLightnessFinal));
     801        bgGrad.setColorAt(1, backgroundColor.lighter(m_iDefaultLightnessStart));
    802802        pPainter->fillRect(rectangle, bgGrad);
    803803    }
     
    822822    /* Selection frame: */
    823823    if (model()->currentItem() == this)
    824         strokeColor = pal.color(QPalette::Active, QPalette::Highlight).lighter(m_iHighlightLightnessMin - 40);
     824        strokeColor = pal.color(QPalette::Active, QPalette::Highlight).lighter(m_iHighlightLightnessStart - 40);
    825825    /* Hovering frame: */
    826826    else if (isHovered())
    827         strokeColor = pal.color(QPalette::Active, QPalette::Highlight).lighter(m_iHoverLightnessMin - 50);
     827        strokeColor = pal.color(QPalette::Active, QPalette::Highlight).lighter(m_iHoverLightnessStart - 40);
    828828    /* Default frame: */
    829829    else
    830         strokeColor = pal.color(QPalette::Active, QPalette::Mid).lighter(m_iDefaultLightnessMin);
     830        strokeColor = pal.color(QPalette::Active, QPalette::Mid).lighter(m_iDefaultLightnessStart);
    831831
    832832    /* Create/assign pen: */
     
    862862        const QColor highlight = pal.color(QPalette::Active, QPalette::Highlight);
    863863        const QColor background = model()->currentItem() == this
    864                                 ? highlight.lighter(m_iHighlightLightnessMin)
    865                                 : highlight.lighter(m_iHoverLightnessMin);
     864                                ? highlight.lighter(m_iHighlightLightnessStart)
     865                                : highlight.lighter(m_iHoverLightnessStart);
    866866
    867867        /* Get foreground color: */
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/tools/UIToolsItem.h

    r82968 r89243  
    289289        int                 m_iAnimatedValue;
    290290
    291         /** Holds minimum default lightness tone. */
    292         int  m_iDefaultLightnessMin;
    293         /** Holds maximum default lightness tone. */
    294         int  m_iDefaultLightnessMax;
    295         /** Holds minimum hover lightness tone. */
    296         int  m_iHoverLightnessMin;
    297         /** Holds maximum hover lightness tone. */
    298         int  m_iHoverLightnessMax;
    299         /** Holds minimum highlight lightness tone. */
    300         int  m_iHighlightLightnessMin;
    301         /** Holds maximum highlight lightness tone. */
    302         int  m_iHighlightLightnessMax;
     291        /** Holds start default lightness tone. */
     292        int  m_iDefaultLightnessStart;
     293        /** Holds final default lightness tone. */
     294        int  m_iDefaultLightnessFinal;
     295        /** Holds start hover lightness tone. */
     296        int  m_iHoverLightnessStart;
     297        /** Holds final hover lightness tone. */
     298        int  m_iHoverLightnessFinal;
     299        /** Holds start highlight lightness tone. */
     300        int  m_iHighlightLightnessStart;
     301        /** Holds final highlight lightness tone. */
     302        int  m_iHighlightLightnessFinal;
    303303    /** @} */
    304304
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