VirtualBox

Changeset 73989 in vbox for trunk/src


Ignore:
Timestamp:
Aug 31, 2018 9:46:25 AM (6 years ago)
Author:
vboxsync
Message:

FE/Qt: VirtualBox Manager UI: Chooser pane re-styling: Machine item: More strict/configurable color tones for hovered/selected item.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserItemMachine.cpp

    r73962 r73989  
    4747    : UIChooserItem(pParent, pParent->isTemporary())
    4848    , UIVirtualMachineItem(machine)
    49     , m_iHoverLightness(0)
    50     , m_iHighlightLightness(0)
    51     , m_iHoverHighlightLightness(0)
     49    , m_iHoverLightnessMin(0)
     50    , m_iHoverLightnessMax(0)
     51    , m_iHighlightLightnessMin(0)
     52    , m_iHighlightLightnessMax(0)
    5253    , m_iFirstRowMaximumWidth(0)
    5354    , m_iMinimumNameWidth(0)
     
    8283    : UIChooserItem(pParent, pParent->isTemporary())
    8384    , UIVirtualMachineItem(pCopyFrom->machine())
    84     , m_iHoverLightness(0)
    85     , m_iHighlightLightness(0)
    86     , m_iHoverHighlightLightness(0)
     85    , m_iHoverLightnessMin(0)
     86    , m_iHoverLightnessMax(0)
     87    , m_iHighlightLightnessMin(0)
     88    , m_iHighlightLightnessMax(0)
    8789    , m_iFirstRowMaximumWidth(0)
    8890    , m_iMinimumNameWidth(0)
     
    585587    /* Colors: */
    586588#ifdef VBOX_WS_MAC
    587     m_iHighlightLightness = 115;
    588     m_iHoverLightness = 110;
    589     m_iHoverHighlightLightness = 120;
     589    m_iHighlightLightnessMin = 105;
     590    m_iHighlightLightnessMax = 115;
     591    m_iHoverLightnessMin = 110;
     592    m_iHoverLightnessMax = 120;
    590593#else /* VBOX_WS_MAC */
    591     m_iHighlightLightness = 130;
    592     m_iHoverLightness = 155;
    593     m_iHoverHighlightLightness = 175;
     594    m_iHighlightLightnessMin = 120;
     595    m_iHighlightLightnessMax = 160;
     596    m_iHoverLightnessMin = 155;
     597    m_iHoverLightnessMax = 175;
    594598#endif /* !VBOX_WS_MAC */
    595599
     
    909913        /* Draw gradient: */
    910914        QLinearGradient bgGrad(rect.topLeft(), rect.bottomLeft());
    911         bgGrad.setColorAt(0, highlight.lighter(m_iHighlightLightness));
    912         bgGrad.setColorAt(1, highlight);
     915        bgGrad.setColorAt(0, highlight.lighter(m_iHighlightLightnessMax));
     916        bgGrad.setColorAt(1, highlight.lighter(m_iHighlightLightnessMin));
    913917        pPainter->fillRect(rect, bgGrad);
    914918    }
     
    920924        /* Draw gradient: */
    921925        QLinearGradient bgGrad(rect.topLeft(), rect.bottomLeft());
    922         bgGrad.setColorAt(0, highlight.lighter(m_iHoverHighlightLightness));
    923         bgGrad.setColorAt(1, highlight.lighter(m_iHoverLightness));
     926        bgGrad.setColorAt(0, highlight.lighter(m_iHoverLightnessMax));
     927        bgGrad.setColorAt(1, highlight.lighter(m_iHoverLightnessMin));
    924928        pPainter->fillRect(rect, bgGrad);
    925929    }
     
    993997        QPalette pal = palette();
    994998        QColor highlight = pal.color(QPalette::Active, QPalette::Highlight);
    995         QColor hhl = highlight.lighter(m_iHoverHighlightLightness);
     999        QColor hhl = highlight.lighter(m_iHoverLightnessMax);
    9961000        if (hhl.value() - hhl.saturation() > 0)
    9971001            pPainter->setPen(pal.color(QPalette::Active, QPalette::Text));
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserItemMachine.h

    r73962 r73989  
    265265    /** @name Item stuff.
    266266      * @{ */
    267         /** Holds item hover lightness. */
    268         int  m_iHoverLightness;
    269         /** Holds item highlight lightness. */
    270         int  m_iHighlightLightness;
    271         /** Holds item hover highlight lightness. */
    272         int  m_iHoverHighlightLightness;
     267        /** Holds item minimum hover lightness. */
     268        int  m_iHoverLightnessMin;
     269        /** Holds item maximum hover lightness. */
     270        int  m_iHoverLightnessMax;
     271        /** Holds item minimum highlight lightness. */
     272        int  m_iHighlightLightnessMin;
     273        /** Holds item maximum highlight lightness. */
     274        int  m_iHighlightLightnessMax;
    273275
    274276        /** Holds item pixmap. */
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