Changeset 89243 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- May 24, 2021 3:39:33 PM (4 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/manager/tools
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/manager/tools/UIToolsItem.cpp
r89242 r89243 189 189 , m_iHoveredValue(100) 190 190 , m_iAnimatedValue(m_iDefaultValue) 191 , m_iDefaultLightness Min(0)192 , m_iDefaultLightness Max(0)193 , m_iHoverLightness Min(0)194 , m_iHoverLightness Max(0)195 , m_iHighlightLightness Min(0)196 , m_iHighlightLightness Max(0)191 , m_iDefaultLightnessStart(0) 192 , m_iDefaultLightnessFinal(0) 193 , m_iHoverLightnessStart(0) 194 , m_iHoverLightnessFinal(0) 195 , m_iHighlightLightnessStart(0) 196 , m_iHighlightLightnessFinal(0) 197 197 , m_iPreviousMinimumWidthHint(0) 198 198 , m_iPreviousMinimumHeightHint(0) … … 443 443 /* Prepare color tones: */ 444 444 #ifdef VBOX_WS_MAC 445 m_i HighlightLightnessMin= 105;446 m_i HighlightLightnessMax= 115;447 m_iHoverLightness Min= 115;448 m_iHoverLightness Max= 125;449 m_i DefaultLightnessMin= 145;450 m_i DefaultLightnessMax= 155;445 m_iDefaultLightnessStart = 105; 446 m_iDefaultLightnessFinal = 115; 447 m_iHoverLightnessStart = 115; 448 m_iHoverLightnessFinal = 125; 449 m_iHighlightLightnessStart = 145; 450 m_iHighlightLightnessFinal = 155; 451 451 #else /* VBOX_WS_MAC */ 452 m_iHighlightLightness Min= 130;453 m_iHighlightLightness Max= 160;454 m_iHoverLightness Min= 160;455 m_iHoverLightness Max= 190;456 m_iDefaultLightness Min= 160;457 m_iDefaultLightness Max= 190;452 m_iHighlightLightnessStart = 130; 453 m_iHighlightLightnessFinal = 160; 454 m_iHoverLightnessStart = 160; 455 m_iHoverLightnessFinal = 190; 456 m_iDefaultLightnessStart = 160; 457 m_iDefaultLightnessFinal = 190; 458 458 #endif /* !VBOX_WS_MAC */ 459 459 … … 720 720 /* Draw gradient: */ 721 721 QLinearGradient bgGrad(rectangle.topLeft(), rectangle.bottomLeft()); 722 bgGrad.setColorAt(0, backgroundColor.lighter(m_iHighlightLightness Max));723 bgGrad.setColorAt(1, backgroundColor.lighter(m_iHighlightLightness Min));722 bgGrad.setColorAt(0, backgroundColor.lighter(m_iHighlightLightnessFinal)); 723 bgGrad.setColorAt(1, backgroundColor.lighter(m_iHighlightLightnessStart)); 724 724 pPainter->fillRect(rectangle, bgGrad); 725 725 … … 759 759 /* Draw gradient: */ 760 760 QLinearGradient bgGrad(rectangle.topLeft(), rectangle.bottomLeft()); 761 bgGrad.setColorAt(0, backgroundColor.lighter(m_iHoverLightness Max));762 bgGrad.setColorAt(1, backgroundColor.lighter(m_iHoverLightness Min));761 bgGrad.setColorAt(0, backgroundColor.lighter(m_iHoverLightnessFinal)); 762 bgGrad.setColorAt(1, backgroundColor.lighter(m_iHoverLightnessStart)); 763 763 pPainter->fillRect(rectangle, bgGrad); 764 764 … … 798 798 /* Draw gradient: */ 799 799 QLinearGradient bgGrad(rectangle.topLeft(), rectangle.bottomLeft()); 800 bgGrad.setColorAt(0, backgroundColor.lighter(m_iDefaultLightness Max));801 bgGrad.setColorAt(1, backgroundColor.lighter(m_iDefaultLightness Min));800 bgGrad.setColorAt(0, backgroundColor.lighter(m_iDefaultLightnessFinal)); 801 bgGrad.setColorAt(1, backgroundColor.lighter(m_iDefaultLightnessStart)); 802 802 pPainter->fillRect(rectangle, bgGrad); 803 803 } … … 822 822 /* Selection frame: */ 823 823 if (model()->currentItem() == this) 824 strokeColor = pal.color(QPalette::Active, QPalette::Highlight).lighter(m_iHighlightLightness Min- 40);824 strokeColor = pal.color(QPalette::Active, QPalette::Highlight).lighter(m_iHighlightLightnessStart - 40); 825 825 /* Hovering frame: */ 826 826 else if (isHovered()) 827 strokeColor = pal.color(QPalette::Active, QPalette::Highlight).lighter(m_iHoverLightness Min - 50);827 strokeColor = pal.color(QPalette::Active, QPalette::Highlight).lighter(m_iHoverLightnessStart - 40); 828 828 /* Default frame: */ 829 829 else 830 strokeColor = pal.color(QPalette::Active, QPalette::Mid).lighter(m_iDefaultLightness Min);830 strokeColor = pal.color(QPalette::Active, QPalette::Mid).lighter(m_iDefaultLightnessStart); 831 831 832 832 /* Create/assign pen: */ … … 862 862 const QColor highlight = pal.color(QPalette::Active, QPalette::Highlight); 863 863 const QColor background = model()->currentItem() == this 864 ? highlight.lighter(m_iHighlightLightness Min)865 : highlight.lighter(m_iHoverLightness Min);864 ? highlight.lighter(m_iHighlightLightnessStart) 865 : highlight.lighter(m_iHoverLightnessStart); 866 866 867 867 /* Get foreground color: */ -
trunk/src/VBox/Frontends/VirtualBox/src/manager/tools/UIToolsItem.h
r82968 r89243 289 289 int m_iAnimatedValue; 290 290 291 /** Holds minimumdefault lightness tone. */292 int m_iDefaultLightness Min;293 /** Holds maximumdefault lightness tone. */294 int m_iDefaultLightness Max;295 /** Holds minimumhover lightness tone. */296 int m_iHoverLightness Min;297 /** Holds maximumhover lightness tone. */298 int m_iHoverLightness Max;299 /** Holds minimumhighlight lightness tone. */300 int m_iHighlightLightness Min;301 /** Holds maximumhighlight lightness tone. */302 int m_iHighlightLightness Max;291 /** Holds start default lightness tone. */ 292 int m_iDefaultLightnessStart; 293 /** Holds final default lightness tone. */ 294 int m_iDefaultLightnessFinal; 295 /** Holds start hover lightness tone. */ 296 int m_iHoverLightnessStart; 297 /** Holds final hover lightness tone. */ 298 int m_iHoverLightnessFinal; 299 /** Holds start highlight lightness tone. */ 300 int m_iHighlightLightnessStart; 301 /** Holds final highlight lightness tone. */ 302 int m_iHighlightLightnessFinal; 303 303 /** @} */ 304 304
Note:
See TracChangeset
for help on using the changeset viewer.