VirtualBox

Changeset 74617 in vbox for trunk


Ignore:
Timestamp:
Oct 4, 2018 4:19:03 PM (6 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9241: VirtualBox Manager: Sync chooser group item look&feel with chooser machine item.

File:
1 edited

Legend:

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

    r74597 r74617  
    14681468                    iProposedHeight += iChildrenSpacing;
    14691469            }
    1470         }
    1471         /* Minus last spacing: */
    1472         iProposedHeight -= iChildrenSpacing;
     1470            /* Minus last spacing: */
     1471            iProposedHeight -= iChildrenSpacing;
     1472        }
    14731473
    14741474        /* Finally, additional height during animation: */
     
    16681668        /* Calculate top rectangle: */
    16691669        QRect tRect = rect;
    1670         tRect.setBottom(tRect.top() + iFullHeaderHeight);
     1670        if (!m_fClosed)
     1671            tRect.setBottom(tRect.top() + iFullHeaderHeight - 1);
     1672
    16711673        /* Prepare top gradient: */
    16721674        QLinearGradient tGradient(tRect.bottomLeft(), tRect.topLeft());
    16731675        tGradient.setColorAt(1, headerColor.darker(animatedValue()));
    16741676        tGradient.setColorAt(0, headerColor.darker(headerDarkness()));
     1677
    16751678        /* Fill top rectangle: */
    16761679        pPainter->fillRect(tRect, tGradient);
     
    17121715    pPainter->save();
    17131716
     1717    /* Prepare variables: */
     1718    const int iMargin = data(GroupItemData_VerticalMargin).toInt();
     1719    const int iFullHeaderHeight = 2 * iMargin + m_minimumHeaderSize.height();
     1720
    17141721    /* Prepare color: */
    1715     QPalette pal = palette();
    1716     QColor strokeColor;
    1717 
    1718     strokeColor = pal.color(QPalette::Active, QPalette::Mid).lighter(155);
     1722    const QPalette pal = palette();
     1723    const QColor strokeColor = pal.color(QPalette::Active,
     1724                                         model()->currentItems().contains(this) ?
     1725                                         QPalette::Highlight : QPalette::Midlight).darker(headerDarkness() + 10);
    17191726
    17201727    /* Create/assign pen: */
     
    17231730    pPainter->setPen(pen);
    17241731
     1732    /* Calculate top rectangle: */
     1733    QRect tRect = rect;
     1734    if (!m_fClosed)
     1735        tRect.setBottom(tRect.top() + iFullHeaderHeight - 1);
     1736
    17251737    /* Draw borders: */
    1726     pPainter->drawLine(rect.topLeft(),    rect.topRight() + QPoint(1, 0));
    1727     pPainter->drawLine(rect.bottomLeft(), rect.bottomRight() + QPoint(1, 0));
    1728     pPainter->drawLine(rect.topLeft(),    rect.bottomLeft());
     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());
    17291741
    17301742    /* Restore painter: */
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