Changeset 74977 in vbox
- Timestamp:
- Oct 22, 2018 5:45:47 PM (6 years ago)
- svn:sync-xref-src-repo-rev:
- 125999
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/manager
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserItemGlobal.cpp
r74878 r74977 42 42 UIChooserItemGlobal::UIChooserItemGlobal(UIChooserItem *pParent, 43 43 int iPosition /* = -1 */) 44 : UIChooserItem(pParent, pParent->isTemporary() )44 : UIChooserItem(pParent, pParent->isTemporary(), 0, 100) 45 45 , m_iDefaultLightnessMin(0) 46 46 , m_iDefaultLightnessMax(0) … … 75 75 UIChooserItemGlobal * , 76 76 int iPosition /* = -1 */) 77 : UIChooserItem(pParent, pParent->isTemporary() )77 : UIChooserItem(pParent, pParent->isTemporary(), 0, 100) 78 78 , m_iDefaultLightnessMin(0) 79 79 , m_iDefaultLightnessMax(0) … … 594 594 bgGrad.setColorAt(1, backgroundColor.lighter(m_iHighlightLightnessMin)); 595 595 pPainter->fillRect(rectangle, bgGrad); 596 597 if (isHovered()) 598 { 599 /* Prepare color: */ 600 QColor animationColor1 = QColor(Qt::white); 601 QColor animationColor2 = QColor(Qt::white); 602 #ifdef VBOX_WS_MAC 603 animationColor1.setAlpha(90); 604 #else 605 animationColor1.setAlpha(30); 606 #endif 607 animationColor2.setAlpha(0); 608 /* Draw hovering animated gradient: */ 609 QRect animatedRect = rectangle; 610 animatedRect.setWidth(animatedRect.height()); 611 const int iLength = 2 * animatedRect.width() + rectangle.width(); 612 const int iShift = - animatedRect.width() + iLength * animatedValue() / 100; 613 animatedRect.moveLeft(iShift); 614 QLinearGradient bgAnimatedGrad(animatedRect.topLeft(), animatedRect.bottomRight()); 615 bgAnimatedGrad.setColorAt(0, animationColor2); 616 bgAnimatedGrad.setColorAt(0.1, animationColor2); 617 bgAnimatedGrad.setColorAt(0.5, animationColor1); 618 bgAnimatedGrad.setColorAt(0.9, animationColor2); 619 bgAnimatedGrad.setColorAt(1, animationColor2); 620 pPainter->fillRect(rectangle, bgAnimatedGrad); 621 } 596 622 } 597 623 /* Hovering background: */ … … 605 631 bgGrad.setColorAt(1, backgroundColor.lighter(m_iHoverLightnessMin)); 606 632 pPainter->fillRect(rectangle, bgGrad); 633 634 /* Prepare color: */ 635 QColor animationColor1 = QColor(Qt::white); 636 QColor animationColor2 = QColor(Qt::white); 637 #ifdef VBOX_WS_MAC 638 animationColor1.setAlpha(120); 639 #else 640 animationColor1.setAlpha(50); 641 #endif 642 animationColor2.setAlpha(0); 643 /* Draw hovering animated gradient: */ 644 QRect animatedRect = rectangle; 645 animatedRect.setWidth(animatedRect.height()); 646 const int iLength = 2 * animatedRect.width() + rectangle.width(); 647 const int iShift = - animatedRect.width() + iLength * animatedValue() / 100; 648 animatedRect.moveLeft(iShift); 649 QLinearGradient bgAnimatedGrad(animatedRect.topLeft(), animatedRect.bottomRight()); 650 bgAnimatedGrad.setColorAt(0, animationColor2); 651 bgAnimatedGrad.setColorAt(0.1, animationColor2); 652 bgAnimatedGrad.setColorAt(0.5, animationColor1); 653 bgAnimatedGrad.setColorAt(0.9, animationColor2); 654 bgAnimatedGrad.setColorAt(1, animationColor2); 655 pPainter->fillRect(rectangle, bgAnimatedGrad); 607 656 } 608 657 /* Default background: */ -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserItemMachine.cpp
r74942 r74977 48 48 49 49 UIChooserItemMachine::UIChooserItemMachine(UIChooserItem *pParent, 50 51 52 : UIChooserItem(pParent, pParent->isTemporary() )50 const CMachine &machine, 51 int iPosition /* = -1 */) 52 : UIChooserItem(pParent, pParent->isTemporary(), 0, 100) 53 53 , UIVirtualMachineItem(machine) 54 54 , m_iDefaultLightnessMin(0) … … 86 86 87 87 UIChooserItemMachine::UIChooserItemMachine(UIChooserItem *pParent, 88 89 90 : UIChooserItem(pParent, pParent->isTemporary() )88 UIChooserItemMachine *pCopyFrom, 89 int iPosition /* = -1 */) 90 : UIChooserItem(pParent, pParent->isTemporary(), 0, 100) 91 91 , UIVirtualMachineItem(pCopyFrom->machine()) 92 92 , m_iDefaultLightnessMin(0) … … 961 961 bgGrad.setColorAt(1, backgroundColor.lighter(m_iHighlightLightnessMin)); 962 962 pPainter->fillRect(rectangle, bgGrad); 963 964 if (isHovered()) 965 { 966 /* Prepare color: */ 967 QColor animationColor1 = QColor(Qt::white); 968 QColor animationColor2 = QColor(Qt::white); 969 #ifdef VBOX_WS_MAC 970 animationColor1.setAlpha(90); 971 #else 972 animationColor1.setAlpha(30); 973 #endif 974 animationColor2.setAlpha(0); 975 /* Draw hovering animated gradient: */ 976 QRect animatedRect = rectangle; 977 animatedRect.setWidth(animatedRect.height()); 978 const int iLength = 2 * animatedRect.width() + rectangle.width(); 979 const int iShift = - animatedRect.width() + iLength * animatedValue() / 100; 980 animatedRect.moveLeft(iShift); 981 QLinearGradient bgAnimatedGrad(animatedRect.topLeft(), animatedRect.bottomRight()); 982 bgAnimatedGrad.setColorAt(0, animationColor2); 983 bgAnimatedGrad.setColorAt(0.1, animationColor2); 984 bgAnimatedGrad.setColorAt(0.5, animationColor1); 985 bgAnimatedGrad.setColorAt(0.9, animationColor2); 986 bgAnimatedGrad.setColorAt(1, animationColor2); 987 pPainter->fillRect(rectangle, bgAnimatedGrad); 988 } 963 989 } 964 990 /* Hovering background: */ … … 972 998 bgGrad.setColorAt(1, backgroundColor.lighter(m_iHoverLightnessMin)); 973 999 pPainter->fillRect(rectangle, bgGrad); 1000 1001 /* Prepare color: */ 1002 QColor animationColor1 = QColor(Qt::white); 1003 QColor animationColor2 = QColor(Qt::white); 1004 #ifdef VBOX_WS_MAC 1005 animationColor1.setAlpha(120); 1006 #else 1007 animationColor1.setAlpha(50); 1008 #endif 1009 animationColor2.setAlpha(0); 1010 /* Draw hovering animated gradient: */ 1011 QRect animatedRect = rectangle; 1012 animatedRect.setWidth(animatedRect.height()); 1013 const int iLength = 2 * animatedRect.width() + rectangle.width(); 1014 const int iShift = - animatedRect.width() + iLength * animatedValue() / 100; 1015 animatedRect.moveLeft(iShift); 1016 QLinearGradient bgAnimatedGrad(animatedRect.topLeft(), animatedRect.bottomRight()); 1017 bgAnimatedGrad.setColorAt(0, animationColor2); 1018 bgAnimatedGrad.setColorAt(0.1, animationColor2); 1019 bgAnimatedGrad.setColorAt(0.5, animationColor1); 1020 bgAnimatedGrad.setColorAt(0.9, animationColor2); 1021 bgAnimatedGrad.setColorAt(1, animationColor2); 1022 pPainter->fillRect(rectangle, bgAnimatedGrad); 974 1023 } 975 1024 /* Default background: */ -
trunk/src/VBox/Frontends/VirtualBox/src/manager/tools/UIToolsItem.cpp
r74962 r74977 192 192 , m_pHoveringAnimationBackward(0) 193 193 , m_iAnimationDuration(400) 194 , m_iDefaultValue( 100)195 , m_iHoveredValue( 90)194 , m_iDefaultValue(0) 195 , m_iHoveredValue(100) 196 196 , m_iAnimatedValue(m_iDefaultValue) 197 197 , m_iDefaultLightnessMin(0) … … 714 714 bgGrad.setColorAt(1, backgroundColor.lighter(m_iHighlightLightnessMin)); 715 715 pPainter->fillRect(rectangle, bgGrad); 716 717 if (isEnabled() && isHovered()) 718 { 719 /* Prepare color: */ 720 QColor animationColor1 = QColor(Qt::white); 721 QColor animationColor2 = QColor(Qt::white); 722 #ifdef VBOX_WS_MAC 723 animationColor1.setAlpha(90); 724 #else 725 animationColor1.setAlpha(30); 726 #endif 727 animationColor2.setAlpha(0); 728 /* Draw hovering animated gradient: */ 729 QRect animatedRect = rectangle; 730 animatedRect.setWidth(animatedRect.height()); 731 const int iLength = 2 * animatedRect.width() + rectangle.width(); 732 const int iShift = - animatedRect.width() + iLength * animatedValue() / 100; 733 animatedRect.moveLeft(iShift); 734 QLinearGradient bgAnimatedGrad(animatedRect.topLeft(), animatedRect.bottomRight()); 735 bgAnimatedGrad.setColorAt(0, animationColor2); 736 bgAnimatedGrad.setColorAt(0.1, animationColor2); 737 bgAnimatedGrad.setColorAt(0.5, animationColor1); 738 bgAnimatedGrad.setColorAt(0.9, animationColor2); 739 bgAnimatedGrad.setColorAt(1, animationColor2); 740 pPainter->fillRect(rectangle, bgAnimatedGrad); 716 741 } 742 } 717 743 /* Hovering background: */ 718 744 else if (isHovered()) … … 727 753 bgGrad.setColorAt(1, backgroundColor.lighter(m_iHoverLightnessMin)); 728 754 pPainter->fillRect(rectangle, bgGrad); 755 756 if (isEnabled()) 757 { 758 /* Prepare color: */ 759 QColor animationColor1 = QColor(Qt::white); 760 QColor animationColor2 = QColor(Qt::white); 761 #ifdef VBOX_WS_MAC 762 animationColor1.setAlpha(120); 763 #else 764 animationColor1.setAlpha(50); 765 #endif 766 animationColor2.setAlpha(0); 767 /* Draw hovering animated gradient: */ 768 QRect animatedRect = rectangle; 769 animatedRect.setWidth(animatedRect.height()); 770 const int iLength = 2 * animatedRect.width() + rectangle.width(); 771 const int iShift = - animatedRect.width() + iLength * animatedValue() / 100; 772 animatedRect.moveLeft(iShift); 773 QLinearGradient bgAnimatedGrad(animatedRect.topLeft(), animatedRect.bottomRight()); 774 bgAnimatedGrad.setColorAt(0, animationColor2); 775 bgAnimatedGrad.setColorAt(0.1, animationColor2); 776 bgAnimatedGrad.setColorAt(0.5, animationColor1); 777 bgAnimatedGrad.setColorAt(0.9, animationColor2); 778 bgAnimatedGrad.setColorAt(1, animationColor2); 779 pPainter->fillRect(rectangle, bgAnimatedGrad); 729 780 } 781 } 730 782 /* Default background: */ 731 783 else
Note:
See TracChangeset
for help on using the changeset viewer.