- Timestamp:
- Oct 3, 2018 2:25:09 PM (6 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/manager
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManagerWidget.cpp
r74578 r74596 441 441 m_pToolBar->setContextMenuPolicy(Qt::CustomContextMenu); 442 442 m_pToolBar->setToolButtonStyle(Qt::ToolButtonTextUnderIcon); 443 #ifdef VBOX_WS_MAC 444 m_pToolBar->emulateMacToolbar(); 445 #endif 443 446 444 447 /* Add tool-bar into layout: */ -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserItemGlobal.cpp
r74548 r74596 43 43 int iPosition /* = -1 */) 44 44 : UIChooserItem(pParent, pParent->isTemporary()) 45 , m_iHoverLightness(0) 46 , m_iHighlightLightness(0) 47 , m_iHoverHighlightLightness(0) 45 , m_iDefaultLightnessMin(0) 46 , m_iDefaultLightnessMax(0) 47 , m_iHoverLightnessMin(0) 48 , m_iHoverLightnessMax(0) 49 , m_iHighlightLightnessMin(0) 50 , m_iHighlightLightnessMax(0) 48 51 , m_iMinimumNameWidth(0) 49 52 , m_iMaximumNameWidth(0) … … 73 76 int iPosition /* = -1 */) 74 77 : UIChooserItem(pParent, pParent->isTemporary()) 75 , m_iHoverLightness(0) 76 , m_iHighlightLightness(0) 77 , m_iHoverHighlightLightness(0) 78 , m_iDefaultLightnessMin(0) 79 , m_iDefaultLightnessMax(0) 80 , m_iHoverLightnessMin(0) 81 , m_iHoverLightnessMax(0) 82 , m_iHighlightLightnessMin(0) 83 , m_iHighlightLightnessMax(0) 78 84 , m_iMinimumNameWidth(0) 79 85 , m_iMaximumNameWidth(0) … … 416 422 /* Colors: */ 417 423 #ifdef VBOX_WS_MAC 418 m_iHighlightLightness = 115; 419 m_iHoverLightness = 110; 420 m_iHoverHighlightLightness = 120; 424 m_iHighlightLightnessMin = 105; 425 m_iHighlightLightnessMax = 115; 426 m_iHoverLightnessMin = 115; 427 m_iHoverLightnessMax = 125; 428 m_iDefaultLightnessMin = 125; 429 m_iDefaultLightnessMax = 130; 421 430 #else /* VBOX_WS_MAC */ 422 m_iHighlightLightness = 130; 423 m_iHoverLightness = 155; 424 m_iHoverHighlightLightness = 175; 431 m_iHighlightLightnessMin = 130; 432 m_iHighlightLightnessMax = 160; 433 m_iHoverLightnessMin = 160; 434 m_iHoverLightnessMax = 190; 435 m_iDefaultLightnessMin = 160; 436 m_iDefaultLightnessMax = 190; 425 437 #endif /* !VBOX_WS_MAC */ 426 438 … … 576 588 { 577 589 /* Prepare color: */ 578 QColor highlight= pal.color(QPalette::Active, QPalette::Highlight);590 QColor backgroundColor = pal.color(QPalette::Active, QPalette::Highlight); 579 591 /* Draw gradient: */ 580 592 QLinearGradient bgGrad(rectangle.topLeft(), rectangle.bottomLeft()); 581 bgGrad.setColorAt(0, highlight.lighter(m_iHighlightLightness));582 bgGrad.setColorAt(1, highlight);593 bgGrad.setColorAt(0, backgroundColor.lighter(m_iHighlightLightnessMax)); 594 bgGrad.setColorAt(1, backgroundColor.lighter(m_iHighlightLightnessMin)); 583 595 pPainter->fillRect(rectangle, bgGrad); 584 596 } … … 587 599 { 588 600 /* Prepare color: */ 589 QColor highlight= pal.color(QPalette::Active, QPalette::Highlight);601 QColor backgroundColor = pal.color(QPalette::Active, QPalette::Highlight); 590 602 /* Draw gradient: */ 591 603 QLinearGradient bgGrad(rectangle.topLeft(), rectangle.bottomLeft()); 592 bgGrad.setColorAt(0, highlight.lighter(m_iHoverHighlightLightness));593 bgGrad.setColorAt(1, highlight.lighter(m_iHoverLightness));604 bgGrad.setColorAt(0, backgroundColor.lighter(m_iHoverLightnessMax)); 605 bgGrad.setColorAt(1, backgroundColor.lighter(m_iHoverLightnessMin)); 594 606 pPainter->fillRect(rectangle, bgGrad); 607 } 608 /* Default background: */ 609 else 610 { 611 #ifdef VBOX_WS_MAC 612 /* Prepare color: */ 613 QColor backgroundColor = pal.color(QPalette::Active, QPalette::Mid); 614 /* Draw gradient: */ 615 QLinearGradient bgGrad(rectangle.topLeft(), rectangle.bottomLeft()); 616 bgGrad.setColorAt(0, backgroundColor.lighter(m_iDefaultLightnessMax)); 617 bgGrad.setColorAt(1, backgroundColor.lighter(m_iDefaultLightnessMin)); 618 pPainter->fillRect(rectangle, bgGrad); 619 #else 620 /* Prepare color: */ 621 QColor backgroundColor = pal.color(QPalette::Active, QPalette::Mid); 622 /* Draw gradient: */ 623 QLinearGradient bgGrad(rectangle.topLeft(), rectangle.bottomLeft()); 624 bgGrad.setColorAt(0, backgroundColor.lighter(m_iDefaultLightnessMax)); 625 bgGrad.setColorAt(1, backgroundColor.lighter(m_iDefaultLightnessMin)); 626 pPainter->fillRect(rectangle, bgGrad); 627 #endif 595 628 } 596 629 … … 619 652 pPainter->setPen(pen); 620 653 621 /* Draw rectangle: */ 622 pPainter->drawRect(rectangle); 654 /* Draw borders: */ 655 pPainter->drawLine(rectangle.topLeft(), rectangle.topRight() + QPoint(1, 0)); 656 pPainter->drawLine(rectangle.bottomLeft(), rectangle.bottomRight() + QPoint(1, 0)); 657 pPainter->drawLine(rectangle.topLeft(), rectangle.bottomLeft()); 623 658 624 659 /* Restore painter: */ … … 647 682 const QPalette pal = palette(); 648 683 const QColor highlight = pal.color(QPalette::Active, QPalette::Highlight); 649 const QColor hhl = highlight.lighter(m_iHover HighlightLightness);684 const QColor hhl = highlight.lighter(m_iHoverLightnessMax); 650 685 if (hhl.value() - hhl.saturation() > 0) 651 686 pPainter->setPen(pal.color(QPalette::Active, QPalette::Text)); -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserItemGlobal.h
r74482 r74596 226 226 /** @name Item stuff. 227 227 * @{ */ 228 /** Holds item hover lightness. */ 229 int m_iHoverLightness; 230 /** Holds item highlight lightness. */ 231 int m_iHighlightLightness; 232 /** Holds item hover highlight lightness. */ 233 int m_iHoverHighlightLightness; 228 /** Holds item minimum default lightness. */ 229 int m_iDefaultLightnessMin; 230 /** Holds item maximum default lightness. */ 231 int m_iDefaultLightnessMax; 232 /** Holds item minimum hover lightness. */ 233 int m_iHoverLightnessMin; 234 /** Holds item maximum hover lightness. */ 235 int m_iHoverLightnessMax; 236 /** Holds item minimum highlight lightness. */ 237 int m_iHighlightLightnessMin; 238 /** Holds item maximum highlight lightness. */ 239 int m_iHighlightLightnessMax; 234 240 235 241 /** Holds item pixmap. */
Note:
See TracChangeset
for help on using the changeset viewer.