VirtualBox

Changeset 74109 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Sep 6, 2018 10:14:20 AM (6 years ago)
Author:
vboxsync
Message:

FE/Qt: VirtualBox Manager UI: Details pane re-styling: Let the background color be light, while frame color come from group item, not from scene background.

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

Legend:

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

    r74083 r74109  
    6666    setAutoFillBackground(true);
    6767    QPalette pal = qApp->palette();
    68     const QColor bodyColor = pal.color(QPalette::Active, QPalette::Midlight).darker(110);
     68    const QColor bodyColor = pal.color(QPalette::Active, QPalette::Mid).lighter(155);
    6969    pal.setColor(QPalette::Base, bodyColor);
    7070    setPalette(pal);
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/details/UIDetailsGroup.cpp

    r74042 r74109  
    2222/* Qt include: */
    2323# include <QGraphicsScene>
     24# include <QPainter>
    2425# include <QStyle>
     26# include <QStyleOptionGraphicsItem>
    2527
    2628/* GUI includes: */
     
    161163}
    162164
     165void UIDetailsGroup::paint(QPainter *pPainter, const QStyleOptionGraphicsItem *pOptions, QWidget *)
     166{
     167    /* Paint background: */
     168    paintBackground(pPainter, pOptions);
     169}
     170
    163171void UIDetailsGroup::addItem(UIDetailsItem *pItem)
    164172{
     
    305313    return QVariant();
    306314}
     315
     316void UIDetailsGroup::paintBackground(QPainter *pPainter, const QStyleOptionGraphicsItem *pOptions) const
     317{
     318    /* Save painter: */
     319    pPainter->save();
     320
     321    /* Prepare variables: */
     322    const QRect optionRect = pOptions->rect;
     323
     324    /* Paint default background: */
     325    const QColor defaultColor = palette().color(QPalette::Active, QPalette::Midlight).darker(110);
     326    pPainter->fillRect(optionRect, defaultColor);
     327
     328    /* Restore painter: */
     329    pPainter->restore();
     330}
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/details/UIDetailsGroup.h

    r74044 r74109  
    8585protected:
    8686
     87    /** @name Event-handling stuff.
     88      * @{ */
     89        /** Performs painting using passed @a pPainter, @a pOptions and optionally specified @a pWidget. */
     90        virtual void paint(QPainter *pPainter, const QStyleOptionGraphicsItem *pOptions, QWidget *pWidget = 0) /* override */;
     91    /** @} */
     92
    8793    /** @name Item stuff.
    8894      * @{ */
     
    140146    /** @} */
    141147
     148    /** @name Painting stuff.
     149      * @{ */
     150        /** Paints background using specified @a pPainter and certain @a pOptions. */
     151        void paintBackground(QPainter *pPainter, const QStyleOptionGraphicsItem *pOptions) const;
     152    /** @} */
     153
    142154    /** @name Item stuff.
    143155      * @{ */
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/details/UIDetailsView.cpp

    r74083 r74109  
    182182    /* Setup palette: */
    183183    QPalette pal = qApp->palette();
    184     const QColor bodyColor = pal.color(QPalette::Active, QPalette::Midlight).darker(110);
     184    const QColor bodyColor = pal.color(QPalette::Active, QPalette::Mid).lighter(155);
    185185    pal.setColor(QPalette::Base, bodyColor);
    186186    setPalette(pal);
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