- Timestamp:
- Aug 18, 2012 12:54:44 PM (12 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserItem.cpp
r42832 r42872 46 46 , m_iAnimationDuration(400) 47 47 , m_iDefaultDarkness(103) 48 , m_iBlackoutDarkness(110) 48 49 , m_iHighlightDarkness(90) 49 , m_iGradient(m_iDefaultDarkness) 50 , m_iStrokeDarkness(130) 51 , m_iAnimationDarkness(m_iDefaultDarkness) 50 52 { 51 53 /* Basic item setup: */ … … 67 69 68 70 /* Forward animation: */ 69 m_pForwardAnimation = new QPropertyAnimation(this, " gradient", this);71 m_pForwardAnimation = new QPropertyAnimation(this, "animationDarkness", this); 70 72 m_pForwardAnimation->setDuration(m_iAnimationDuration); 71 73 m_pForwardAnimation->setStartValue(m_iDefaultDarkness); … … 73 75 74 76 /* Backward animation: */ 75 m_pBackwardAnimation = new QPropertyAnimation(this, " gradient", this);77 m_pBackwardAnimation = new QPropertyAnimation(this, "animationDarkness", this); 76 78 m_pBackwardAnimation->setDuration(m_iAnimationDuration); 77 79 m_pBackwardAnimation->setStartValue(m_iHighlightDarkness); -
trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserItem.h
r42734 r42872 52 52 { 53 53 Q_OBJECT; 54 Q_PROPERTY(int gradient READ gradient WRITE setGradient);54 Q_PROPERTY(int animationDarkness READ animationDarkness WRITE setAnimationDarkness); 55 55 56 56 signals: … … 140 140 141 141 /* Hover stuff: */ 142 int gradient() const { return m_iGradient; } 143 void setGradient(int iGradient) { m_iGradient = iGradient; update(); } 142 void setAnimationDarkness(int iAnimationDarkness) { m_iAnimationDarkness = iAnimationDarkness; update(); } 143 144 /* Color stuff: */ 145 int defaultDarkness() const { return m_iDefaultDarkness; } 146 int blackoutDarkness() const { return m_iBlackoutDarkness; } 147 int highlightDarkness() const { return m_iHighlightDarkness; } 148 int strokeDarkness() const { return m_iStrokeDarkness; } 149 int animationDarkness() const { return m_iAnimationDarkness; } 150 int dragTokenDarkness() const { return m_iDragTokenDarkness; } 144 151 145 152 /* Helpers: Text compression stuff: */ … … 162 169 int m_iAnimationDuration; 163 170 int m_iDefaultDarkness; 171 int m_iBlackoutDarkness; 164 172 int m_iHighlightDarkness; 165 int m_iGradient; 173 int m_iStrokeDarkness; 174 int m_iAnimationDarkness; 175 int m_iDragTokenDarkness; 166 176 }; 167 177 -
trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserItemGroup.cpp
r42828 r42872 703 703 704 704 /* Prepare body indent: */ 705 iPreviousVerticalIndent = 2* iVerticalMargin + iFullHeaderHeight;705 iPreviousVerticalIndent = 3 * iVerticalMargin + iFullHeaderHeight; 706 706 } 707 707 … … 790 790 if (!fClosedGroup) 791 791 { 792 /* We should take into account: */ 792 /* We should take into account vertical indent: */ 793 iProposedHeight += iVerticalMargin; 794 /* And every item height: */ 793 795 QList<UIGChooserItem*> allItems = items(); 794 796 for (int i = 0; i < allItems.size(); ++i) 795 797 { 796 /* Every item height: */797 798 UIGChooserItem *pItem = allItems[i]; 798 799 iProposedHeight += (pItem->minimumHeightHint() + iMinorSpacing); … … 1080 1081 /* Prepare color: */ 1081 1082 QPalette pal = palette(); 1082 QColor base = pal.color(QPalette::Active, model()->selectionList().contains(this) ? 1083 QPalette::Highlight : QPalette::Window); 1083 QColor windowColor = pal.color(QPalette::Active, model()->selectionList().contains(this) ? 1084 QPalette::Highlight : QPalette::Window); 1085 QColor base(Qt::white); 1084 1086 1085 1087 /* Root item: */ … … 1090 1092 { 1091 1093 /* Simple and clear: */ 1092 pPainter->fillRect(rect, base );1094 pPainter->fillRect(rect, base.darker(106)); 1093 1095 } 1094 1096 else … … 1113 1115 /* Fill background: */ 1114 1116 QLinearGradient headerGradient(backgroundRect.bottomLeft(), backgroundRect.topLeft()); 1115 headerGradient.setColorAt( 0, base.darker(gradient()));1116 headerGradient.setColorAt( 1, base.darker(110));1117 headerGradient.setColorAt(1, windowColor.darker(blackoutDarkness())); 1118 headerGradient.setColorAt(0, windowColor.darker(animationDarkness())); 1117 1119 pPainter->fillRect(backgroundRect, headerGradient); 1118 1120 1119 1121 /* Stroke path: */ 1120 1122 pPainter->setClipping(false); 1121 pPainter->strokePath(path, base.darker(130));1123 pPainter->strokePath(path, windowColor.darker(strokeDarkness())); 1122 1124 } 1123 1125 } … … 1149 1151 /* Prepare top gradient: */ 1150 1152 QLinearGradient tGradient(tRect.bottomLeft(), tRect.topLeft()); 1151 tGradient.setColorAt( 0, base.darker(110));1152 tGradient.setColorAt( 1, base.darker(gradient()));1153 tGradient.setColorAt(1, windowColor.darker(animationDarkness())); 1154 tGradient.setColorAt(0, windowColor.darker(blackoutDarkness())); 1153 1155 /* Fill top rectangle: */ 1154 1156 pPainter->fillRect(tRect, tGradient); … … 1159 1161 QRect midRect = QRect(tRect.bottomLeft(), rect.bottomRight()); 1160 1162 /* Paint all the stuff: */ 1161 pPainter->fillRect(midRect, base.darker( 110));1163 pPainter->fillRect(midRect, base.darker(defaultDarkness())); 1162 1164 } 1163 1165 1164 1166 /* Stroke path: */ 1165 1167 pPainter->setClipping(false); 1166 pPainter->strokePath(path, base.darker(130));1168 pPainter->strokePath(path, windowColor.darker(strokeDarkness())); 1167 1169 pPainter->setClipPath(path); 1168 1170 … … 1184 1186 dragTokenGradient.setFinalStop(dragTokenRect.bottomLeft()); 1185 1187 } 1186 dragTokenGradient.setColorAt(0, base.darker(110));1187 dragTokenGradient.setColorAt(1, base.darker(150));1188 dragTokenGradient.setColorAt(0, windowColor.darker(blackoutDarkness())); 1189 dragTokenGradient.setColorAt(1, windowColor.darker(dragTokenDarkness())); 1188 1190 pPainter->fillRect(dragTokenRect, dragTokenGradient); 1189 1191 } -
trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserItemMachine.cpp
r42828 r42872 556 556 /* Prepare top gradient: */ 557 557 QLinearGradient tGradient(tRect.bottomLeft(), tRect.topLeft()); 558 tGradient.setColorAt( 0, highlight.darker(103));559 tGradient.setColorAt( 1, highlight.darker(110));558 tGradient.setColorAt(1, highlight.darker(blackoutDarkness())); 559 tGradient.setColorAt(0, highlight.darker(defaultDarkness())); 560 560 /* Prepare bottom gradient: */ 561 561 QLinearGradient bGradient(bRect.topLeft(), bRect.bottomLeft()); 562 bGradient.setColorAt(0, highlight.darker( 103));563 bGradient.setColorAt(1, highlight.darker( 110));562 bGradient.setColorAt(0, highlight.darker(defaultDarkness())); 563 bGradient.setColorAt(1, highlight.darker(blackoutDarkness())); 564 564 565 565 /* Paint all the stuff: */ 566 pPainter->fillRect(midRect, highlight.darker( 103));566 pPainter->fillRect(midRect, highlight.darker(defaultDarkness())); 567 567 pPainter->fillRect(tRect, tGradient); 568 568 pPainter->fillRect(bRect, bGradient); … … 573 573 { 574 574 /* Choose color: */ 575 QColor baseLight = pal.color(QPalette::Active, model()->selectionList().contains(this) || 576 model()->selectionList().contains(parentItem()) ? 577 QPalette::Highlight : QPalette::Window); 578 QColor blurBase = pal.color(QPalette::Active, model()->selectionList().contains(this) || 579 model()->selectionList().contains(parentItem()) ? 580 QPalette::Highlight : QPalette::Window); 581 if (!parentItem()->isRoot()) 582 blurBase = blurBase.darker(110); 575 QColor baseLight = model()->selectionList().contains(this) ? pal.color(QPalette::Active, QPalette::Highlight) : 576 QColor(Qt::white); 577 QColor blurBase = model()->selectionList().contains(this) ? pal.color(QPalette::Active, QPalette::Highlight) : 578 QColor(Qt::white); 579 if (!model()->selectionList().contains(this) && !parentItem()->isRoot()) 580 blurBase = blurBase.darker(defaultDarkness()); 583 581 blurBase.setAlpha(0); 584 582 … … 589 587 /* Add blur itself: */ 590 588 QPainter blurPainter(&background); 591 blurPainter.setBrush(baseLight.darker( gradient()));589 blurPainter.setBrush(baseLight.darker(animationDarkness())); 592 590 blurPainter.setPen(Qt::NoPen); 593 591 blurPainter.drawRoundedRect(rect.adjusted(5, 5, -5, -5), 5, 5); … … 620 618 dragTokenGradient.setFinalStop(dragTokenRect.bottomLeft()); 621 619 } 622 dragTokenGradient.setColorAt(0, base.darker( 110));623 dragTokenGradient.setColorAt(1, base.darker( 150));620 dragTokenGradient.setColorAt(0, base.darker(blackoutDarkness())); 621 dragTokenGradient.setColorAt(1, base.darker(dragTokenDarkness())); 624 622 pPainter->fillRect(dragTokenRect, dragTokenGradient); 625 623 } -
trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserView.cpp
r42802 r42872 30 30 /* Fix palette: */ 31 31 QPalette pal = palette(); 32 pal.setColor(QPalette::Base, pal.color(QPalette::Window));32 pal.setColor(QPalette::Base, QColor(Qt::white).darker(106)); 33 33 setPalette(pal); 34 34 -
trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/details/UIGDetailsElement.cpp
r42856 r42872 54 54 , m_iDefaultDarkness(103) 55 55 , m_iHighlightDarkness(90) 56 , m_i Gradient(m_iDefaultDarkness)56 , m_iAnimationDarkness(m_iDefaultDarkness) 57 57 { 58 58 /* Prepare element: */ … … 416 416 417 417 /* Forward animation: */ 418 m_pForwardAnimation = new QPropertyAnimation(this, " gradient", this);418 m_pForwardAnimation = new QPropertyAnimation(this, "animationDarkness", this); 419 419 m_pForwardAnimation->setDuration(m_iAnimationDuration); 420 420 m_pForwardAnimation->setStartValue(m_iDefaultDarkness); … … 422 422 423 423 /* Backward animation: */ 424 m_pBackwardAnimation = new QPropertyAnimation(this, " gradient", this);424 m_pBackwardAnimation = new QPropertyAnimation(this, "animationDarkness", this); 425 425 m_pBackwardAnimation->setDuration(m_iAnimationDuration); 426 426 m_pBackwardAnimation->setStartValue(m_iHighlightDarkness); … … 691 691 QPalette pal = QApplication::palette(); 692 692 QColor windowColor = pal.color(QPalette::Active, QPalette::Window); 693 QColor base(Qt::white); 694 base = base.darker(m_iDefaultDarkness); 693 695 694 696 /* Add clipping: */ … … 715 717 QLinearGradient tGradient(tRect.bottomLeft(), tRect.topLeft()); 716 718 tGradient.setColorAt(0, windowColor.darker(110)); 717 tGradient.setColorAt(1, windowColor.darker( gradient()));719 tGradient.setColorAt(1, windowColor.darker(animationDarkness())); 718 720 719 721 /* Paint all the stuff: */ 720 722 pPainter->fillRect(tRect, tGradient); 721 pPainter->fillRect(bRect, windowColor.darker(97));723 pPainter->fillRect(bRect, base); 722 724 723 725 /* Stroke path: */ -
trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/details/UIGDetailsElement.h
r42856 r42872 45 45 { 46 46 Q_OBJECT; 47 Q_PROPERTY(int gradient READ gradient WRITE setGradient);47 Q_PROPERTY(int animationDarkness READ animationDarkness WRITE setAnimationDarkness); 48 48 Q_PROPERTY(int additionalHeight READ additionalHeight WRITE setAdditionalHeight); 49 49 … … 144 144 145 145 /* Helpers: Hover stuff: */ 146 int gradient() const { return m_iGradient; }147 void set Gradient(int iGradient) { m_iGradient = iGradient; update(); }146 int animationDarkness() const { return m_iAnimationDarkness; } 147 void setAnimationDarkness(int iAnimationDarkness) { m_iAnimationDarkness = iAnimationDarkness; update(); } 148 148 149 149 /* Helpers: Animation stuff: */ … … 215 215 int m_iDefaultDarkness; 216 216 int m_iHighlightDarkness; 217 int m_i Gradient;217 int m_iAnimationDarkness; 218 218 }; 219 219 -
trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/details/UIGDetailsView.cpp
r42529 r42872 30 30 /* Fix palette: */ 31 31 QPalette pal = palette(); 32 pal.setColor(QPalette::Base, pal.color(QPalette::Window));32 pal.setColor(QPalette::Base, QColor(Qt::white).darker(106)); 33 33 setPalette(pal); 34 34
Note:
See TracChangeset
for help on using the changeset viewer.