VirtualBox

Changeset 74717 in vbox for trunk


Ignore:
Timestamp:
Oct 9, 2018 1:44:30 PM (6 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9241: VirtualBox Manager: Chooser pane: Sync Group item frame with machine/global items.

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

Legend:

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

    r74617 r74717  
    349349void UIChooserItemGroup::paint(QPainter *pPainter, const QStyleOptionGraphicsItem *pOptions, QWidget* /* pWidget = 0 */)
    350350{
     351    /* Acquire rectangle: */
     352    const QRect rectangle = pOptions->rect;
     353
    351354    /* Paint background: */
    352     paintBackground(pPainter, pOptions->rect);
     355    paintBackground(pPainter, rectangle);
    353356    /* Paint frame: */
    354     paintFrameRectangle(pPainter, pOptions->rect);
     357    paintFrame(pPainter, rectangle);
    355358    /* Paint header: */
    356     paintHeader(pPainter, pOptions->rect);
     359    paintHeader(pPainter, rectangle);
    357360}
    358361
     
    859862            pItem->updateLayout();
    860863            /* Advance indent for next items: */
    861             iPreviousVerticalIndent += iMinimumHeight;
    862             if (pItem->type() != UIChooserItemType_Global)
    863                 iPreviousVerticalIndent += iChildrenSpacing;
     864            iPreviousVerticalIndent += (iMinimumHeight + iChildrenSpacing);
    864865        }
    865866    }
     
    14641465            foreach (UIChooserItem *pItem, items())
    14651466            {
    1466                 iProposedHeight += pItem->minimumHeightHint();
    1467                 if (pItem->type() != UIChooserItemType_Global)
    1468                     iProposedHeight += iChildrenSpacing;
     1467                iProposedHeight += (pItem->minimumHeightHint() + iChildrenSpacing);
    14691468            }
    14701469            /* Minus last spacing: */
     
    17061705}
    17071706
    1708 void UIChooserItemGroup::paintFrameRectangle(QPainter *pPainter, const QRect &rect)
     1707void UIChooserItemGroup::paintFrame(QPainter *pPainter, const QRect &rectangle)
    17091708{
    17101709    /* Not for roots: */
     
    17311730
    17321731    /* Calculate top rectangle: */
    1733     QRect tRect = rect;
     1732    QRect topRect = rectangle;
    17341733    if (!m_fClosed)
    1735         tRect.setBottom(tRect.top() + iFullHeaderHeight - 1);
     1734        topRect.setBottom(topRect.top() + iFullHeaderHeight - 1);
    17361735
    17371736    /* Draw borders: */
    1738     pPainter->drawLine(tRect.topLeft(),    tRect.topRight()    + QPoint(1, 0));
    1739     pPainter->drawLine(tRect.bottomLeft(), tRect.bottomRight() + QPoint(1, 0));
    1740     pPainter->drawLine(tRect.topLeft(),    tRect.bottomLeft());
     1737    pPainter->drawLine(topRect.bottomLeft(), topRect.bottomRight() + QPoint(1, 0));
     1738    pPainter->drawLine(topRect.topLeft(),    topRect.bottomLeft());
    17411739
    17421740    /* Restore painter: */
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserItemGroup.h

    r74393 r74717  
    311311        void paintBackground(QPainter *pPainter, const QRect &rect);
    312312        /** Paints frame rectangle using specified @a pPainter and certain @a rect. */
    313         void paintFrameRectangle(QPainter *pPainter, const QRect &rect);
     313        void paintFrame(QPainter *pPainter, const QRect &rect);
    314314        /** Paints header using specified @a pPainter and certain @a rect. */
    315315        void paintHeader(QPainter *pPainter, const QRect &rect);
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