Changeset 75204 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Oct 31, 2018 10:55:45 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserItemMachine.cpp
r75156 r75204 1049 1049 { 1050 1050 /* Window color: */ 1051 QColor base = pal.color(QPalette::Active, model()->currentItems().contains(unconst(this)) ? 1052 QPalette::Highlight : QPalette::Window); 1051 QColor color1; 1052 QColor color2; 1053 1053 1054 QLinearGradient dragTokenGradient; 1054 1055 QRect dragTokenRect = rectangle; 1055 1056 if (dragTokenPlace() == DragToken_Up) 1056 1057 { 1058 /* Selection background: */ 1059 if (model()->currentItems().contains(unconst(this))) 1060 { 1061 QColor backgroundColor = pal.color(QPalette::Active, QPalette::Highlight); 1062 color1 = backgroundColor.lighter(m_iHighlightLightnessMax); 1063 color2 = backgroundColor.lighter(m_iHighlightLightnessMax - 70); 1064 } 1065 /* Default background: */ 1066 else 1067 { 1068 QColor backgroundColor = pal.color(QPalette::Active, QPalette::Mid); 1069 color1 = backgroundColor.lighter(m_iDefaultLightnessMax); 1070 color2 = backgroundColor.lighter(m_iDefaultLightnessMax - 70); 1071 } 1072 1057 1073 dragTokenRect.setHeight(5); 1058 1074 dragTokenGradient.setStart(dragTokenRect.bottomLeft()); … … 1061 1077 else if (dragTokenPlace() == DragToken_Down) 1062 1078 { 1063 dragTokenRect.setTopLeft(dragTokenRect.bottomLeft() - QPoint(0, 5)); 1079 /* Selection background: */ 1080 if (model()->currentItems().contains(unconst(this))) 1081 { 1082 QColor backgroundColor = pal.color(QPalette::Active, QPalette::Highlight); 1083 color1 = backgroundColor.lighter(m_iHighlightLightnessMin); 1084 color2 = backgroundColor.lighter(m_iHighlightLightnessMin - 40); 1085 } 1086 /* Default background: */ 1087 else 1088 { 1089 QColor backgroundColor = pal.color(QPalette::Active, QPalette::Mid); 1090 color1 = backgroundColor.lighter(m_iDefaultLightnessMin); 1091 color2 = backgroundColor.lighter(m_iDefaultLightnessMin - 40); 1092 } 1093 1094 dragTokenRect.setTopLeft(dragTokenRect.bottomLeft() - QPoint(0, 4)); 1064 1095 dragTokenGradient.setStart(dragTokenRect.topLeft()); 1065 1096 dragTokenGradient.setFinalStop(dragTokenRect.bottomLeft()); 1066 1097 } 1067 dragTokenGradient.setColorAt(0, base.darker(dragTokenDarkness()));1068 dragTokenGradient.setColorAt(1, base.darker(dragTokenDarkness() + 40));1098 dragTokenGradient.setColorAt(0, color1); 1099 dragTokenGradient.setColorAt(1, color2); 1069 1100 pPainter->fillRect(dragTokenRect, dragTokenGradient); 1070 1101 } … … 1099 1130 1100 1131 /* Draw borders: */ 1101 pPainter->drawLine(rectangle.topLeft(), rectangle.topRight() + QPoint(1, 0)); 1102 pPainter->drawLine(rectangle.bottomLeft(), rectangle.bottomRight() + QPoint(1, 0)); 1132 if (dragTokenPlace() != DragToken_Up) 1133 pPainter->drawLine(rectangle.topLeft(), rectangle.topRight() + QPoint(1, 0)); 1134 if (dragTokenPlace() != DragToken_Down) 1135 pPainter->drawLine(rectangle.bottomLeft(), rectangle.bottomRight() + QPoint(1, 0)); 1103 1136 pPainter->drawLine(rectangle.topLeft(), rectangle.bottomLeft()); 1104 1137
Note:
See TracChangeset
for help on using the changeset viewer.