- Timestamp:
- Sep 5, 2018 1:30:48 PM (6 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooser.cpp
r73631 r74085 117 117 setAutoFillBackground(true); 118 118 QPalette pal = palette(); 119 pal.setColor(QPalette::Window, pal.color(QPalette::Active, QPalette::Base)); 119 QColor bodyColor = pal.color(QPalette::Active, QPalette::Midlight).darker(110); 120 pal.setColor(QPalette::Window, bodyColor); 120 121 setPalette(pal); 121 122 } -
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: */ -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserView.cpp
r73424 r74085 106 106 QAccessible::installFactory(UIAccessibilityInterfaceForUIChooserView::pFactory); 107 107 108 /* Prepare palette: */ 109 preparePalette(); 110 108 111 /* Setup frame: */ 109 112 setFrameShape(QFrame::NoFrame); … … 168 171 } 169 172 173 void UIChooserView::preparePalette() 174 { 175 /* Setup palette: */ 176 QPalette pal = qApp->palette(); 177 const QColor bodyColor = pal.color(QPalette::Active, QPalette::Midlight).darker(110); 178 pal.setColor(QPalette::Base, bodyColor); 179 setPalette(pal); 180 } 181 170 182 void UIChooserView::resizeEvent(QResizeEvent *pEvent) 171 183 { -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserView.h
r73424 r74085 60 60 virtual void retranslateUi() /* override */; 61 61 62 /* Helper: Prepare stuff: */ 63 void preparePalette(); 64 62 65 /* Handler: Resize-event stuff: */ 63 66 void resizeEvent(QResizeEvent *pEvent);
Note:
See TracChangeset
for help on using the changeset viewer.