VirtualBox

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


Ignore:
Timestamp:
May 19, 2021 2:09:35 PM (4 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:10003: Chooser/Details panes gets more sharp frames; Cleanup a bit of unused code in the same area.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/manager
Files:
6 edited

Legend:

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

    r89138 r89170  
    4848    : UIChooserItem(0, pNode)
    4949    , m_pScene(pScene)
     50    , m_iBackgroundDarknessStart(115)
     51    , m_iBackgroundDarknessFinal(150)
    5052    , m_iAdditionalHeight(0)
    5153    , m_iHeaderDarkness(110)
     
    6870    : UIChooserItem(pParent, pNode)
    6971    , m_pScene(0)
     72    , m_iBackgroundDarknessStart(115)
     73    , m_iBackgroundDarknessFinal(150)
    7074    , m_iAdditionalHeight(0)
    7175    , m_iHeaderDarkness(110)
     
    15881592    pPainter->save();
    15891593
    1590     /* Non-root-item: */
    1591     if (!isRoot())
     1594    /* Root-item: */
     1595    if (isRoot())
     1596    {
     1597        /* Acquire background color: */
     1598        const QColor backgroundColor = QApplication::palette().color(QPalette::Active, QPalette::Window);
     1599
     1600        /* Paint default background: */
     1601        QColor bcTone1 = backgroundColor.darker(m_iBackgroundDarknessStart);
     1602        QColor bcTone2 = backgroundColor.darker(m_iBackgroundDarknessFinal);
     1603        QLinearGradient gradientDefault(rect.topRight(), rect.bottomLeft());
     1604        gradientDefault.setColorAt(0, bcTone1);
     1605        gradientDefault.setColorAt(1, bcTone2);
     1606        pPainter->fillRect(rect, gradientDefault);
     1607    }
     1608    else
    15921609    {
    15931610        /* Prepare color: */
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserItemGroup.h

    r86767 r89170  
    323323        /** Holds the cached machine children info. */
    324324        QString  m_strInfoMachines;
     325
     326        /** Holds the start background darkness. */
     327        int  m_iBackgroundDarknessStart;
     328        /** Holds the final background darkness. */
     329        int  m_iBackgroundDarknessFinal;
    325330
    326331        /** Holds aditional height. */
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/details/UIDetailsGroup.cpp

    r88805 r89170  
    195195}
    196196
    197 void UIDetailsGroup::paint(QPainter *pPainter, const QStyleOptionGraphicsItem *pOptions, QWidget *)
    198 {
    199     /* Paint background: */
    200     paintBackground(pPainter, pOptions);
    201 }
    202 
    203197void UIDetailsGroup::addItem(UIDetailsItem *pItem)
    204198{
     
    274268            model(), &UIDetailsModel::sigRootItemMinimumWidthHintChanged);
    275269}
    276 
    277 void UIDetailsGroup::paintBackground(QPainter *pPainter, const QStyleOptionGraphicsItem *pOptions) const
    278 {
    279     /* Save painter: */
    280     pPainter->save();
    281 
    282     /* Prepare variables: */
    283     const QRect optionRect = pOptions->rect;
    284 
    285     /* Paint default background: */
    286     const QColor backgroundColor = QApplication::palette().color(QPalette::Active, QPalette::Window);
    287     pPainter->fillRect(optionRect, backgroundColor);
    288 
    289     /* Restore painter: */
    290     pPainter->restore();
    291 }
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/details/UIDetailsGroup.h

    r82968 r89170  
    9696protected:
    9797
    98     /** @name Event-handling stuff.
    99       * @{ */
    100         /** Performs painting using passed @a pPainter, @a pOptions and optionally specified @a pWidget. */
    101         virtual void paint(QPainter *pPainter, const QStyleOptionGraphicsItem *pOptions, QWidget *pWidget = 0) /* override */;
    102     /** @} */
    103 
    10498    /** @name Item stuff.
    10599      * @{ */
     
    138132    /** @} */
    139133
    140     /** @name Painting stuff.
    141       * @{ */
    142         /** Paints background using specified @a pPainter and certain @a pOptions. */
    143         void paintBackground(QPainter *pPainter, const QStyleOptionGraphicsItem *pOptions) const;
    144     /** @} */
    145 
    146134    /** @name Item stuff.
    147135      * @{ */
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/details/UIDetailsSet.cpp

    r89159 r89170  
    4444    , m_configurationAccessLevel(ConfigurationAccessLevel_Null)
    4545    , m_pBuildStep(0)
     46    , m_iBackgroundDarknessStart(115)
     47    , m_iBackgroundDarknessFinal(150)
    4648{
    4749    /* Add set to the parent group: */
     
    744746    const QRect optionRect = pOptions->rect;
    745747
     748    /* Acquire background color: */
     749    const QColor backgroundColor = QApplication::palette().color(QPalette::Active, QPalette::Window);
     750
    746751    /* Paint default background: */
    747     const QColor backgroundColor = QApplication::palette().color(QPalette::Active, QPalette::Window);
    748     pPainter->fillRect(optionRect, backgroundColor);
     752    QColor bcTone1 = backgroundColor.darker(m_iBackgroundDarknessStart);
     753    QColor bcTone2 = backgroundColor.darker(m_iBackgroundDarknessFinal);
     754    QLinearGradient gradientDefault(optionRect.topLeft(), optionRect.bottomRight());
     755    gradientDefault.setColorAt(0, bcTone1);
     756    gradientDefault.setColorAt(1, bcTone2);
     757    pPainter->fillRect(optionRect, gradientDefault);
    749758
    750759    /* Restore painter: */
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/details/UIDetailsSet.h

    r89106 r89170  
    213213        /** Holds the generated set ID. */
    214214        QUuid                      m_uSetId;
     215
     216        /** Holds the start background darkness. */
     217        int  m_iBackgroundDarknessStart;
     218        /** Holds the final background darkness. */
     219        int  m_iBackgroundDarknessFinal;
    215220    /** @} */
    216221
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