Changeset 74085 in vbox for trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserItemGroup.cpp
- Timestamp:
- Sep 5, 2018 1:30:48 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserItemGroup.cpp
r74079 r74085 1630 1630 1631 1631 /* Prepare color: */ 1632 QPalette pal = palette(); 1633 QColor headerColor = pal.color(QPalette::Active, 1634 model()->currentItems().contains(this) ? 1635 QPalette::Highlight : QPalette::Midlight); 1636 QColor bodyColor = pal.color(QPalette::Active, QPalette::Midlight).darker(headerDarkness()); 1632 const QPalette pal = palette(); 1633 const QColor headerColor = pal.color(QPalette::Active, 1634 model()->currentItems().contains(this) ? 1635 QPalette::Highlight : QPalette::Midlight); 1637 1636 1638 1637 /* Root-item: */ 1639 1638 if (isRoot()) 1640 1639 { 1641 /* Main root-item: */1642 if (isMainRoot())1643 {1644 /* Simple and clear: */1645 pPainter->fillRect(rect, bodyColor);1646 }1647 1640 /* Non-main root-item: */ 1648 else1641 if (!isMainRoot()) 1649 1642 { 1650 1643 /* Prepare variables: */ 1651 int iMargin = data(GroupItemData_VerticalMargin).toInt(); 1652 int iFullHeaderHeight = 2 * iMargin + m_minimumHeaderSize.height(); 1653 int iFullBodyHeight = rect.height() - iFullHeaderHeight; 1644 const int iMargin = data(GroupItemData_VerticalMargin).toInt(); 1645 const int iFullHeaderHeight = 2 * iMargin + m_minimumHeaderSize.height(); 1654 1646 QRect headerRect = QRect(0, 0, rect.width(), iFullHeaderHeight); 1655 QRect bodyRect = QRect(0, iFullHeaderHeight, rect.width(), iFullBodyHeight);1656 1647 1657 1648 /* Fill background: */ … … 1660 1651 headerGradient.setColorAt(0, headerColor.darker(animatedValue())); 1661 1652 pPainter->fillRect(headerRect, headerGradient); 1662 pPainter->fillRect(bodyRect, bodyColor);1663 1653 } 1664 1654 } … … 1667 1657 { 1668 1658 /* Prepare variables: */ 1669 int iMargin = data(GroupItemData_VerticalMargin).toInt();1670 int iFullHeaderHeight = 2 * iMargin + m_minimumHeaderSize.height();1659 const int iMargin = data(GroupItemData_VerticalMargin).toInt(); 1660 const int iFullHeaderHeight = 2 * iMargin + m_minimumHeaderSize.height(); 1671 1661 1672 1662 /* Calculate top rectangle: */
Note:
See TracChangeset
for help on using the changeset viewer.