Changeset 73990 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Aug 31, 2018 9:55:26 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserItemMachine.cpp
r73989 r73990 618 618 { 619 619 /* Layout hints: */ 620 case MachineItemData_Margin: return QApplication::style()->pixelMetric(QStyle::PM_SmallIconSize) / 4;620 case MachineItemData_Margin: return QApplication::style()->pixelMetric(QStyle::PM_SmallIconSize) / 3 * 2; 621 621 case MachineItemData_MajorSpacing: return QApplication::style()->pixelMetric(QStyle::PM_SmallIconSize) / 2; 622 622 case MachineItemData_MinorSpacing: return QApplication::style()->pixelMetric(QStyle::PM_SmallIconSize) / 4; 623 case MachineItemData_TextSpacing: return 0;623 case MachineItemData_TextSpacing: return 0; 624 624 625 625 /* Pixmaps: */ … … 926 926 bgGrad.setColorAt(0, highlight.lighter(m_iHoverLightnessMax)); 927 927 bgGrad.setColorAt(1, highlight.lighter(m_iHoverLightnessMin)); 928 pPainter->fillRect(rect, bgGrad); 929 } 930 /* Default background: */ 931 else 932 { 933 /* Prepare color: */ 934 QColor usual = pal.color(QPalette::Active, QPalette::Mid); 935 /* Draw gradient: */ 936 QLinearGradient bgGrad(rect.topLeft(), rect.bottomLeft()); 937 bgGrad.setColorAt(0, usual.lighter(m_iHoverLightnessMax)); 938 bgGrad.setColorAt(1, usual.lighter(m_iHoverLightnessMin)); 928 939 pPainter->fillRect(rect, bgGrad); 929 940 } … … 960 971 void UIChooserItemMachine::paintFrameRectangle(QPainter *pPainter, const QRect &rect) 961 972 { 962 /* Only chosen and/or hovered item should have a frame: */963 if (!model()->currentItems().contains(this) && !isHovered())964 return;965 966 973 /* Simple frame: */ 967 974 pPainter->save(); 968 975 QPalette pal = palette(); 969 QColor strokeColor = pal.color(QPalette::Active, 970 model()->currentItems().contains(this) ? 971 QPalette::Mid : QPalette::Highlight); 976 QColor strokeColor; 977 978 /* Selection frame: */ 979 if (model()->currentItems().contains(this)) 980 strokeColor = pal.color(QPalette::Active, QPalette::Mid).darker(110); 981 /* Default frame: */ 982 else 983 strokeColor = pal.color(QPalette::Active, QPalette::Midlight).darker(110); 984 972 985 pPainter->setPen(strokeColor); 973 986 pPainter->drawRect(rect);
Note:
See TracChangeset
for help on using the changeset viewer.