Changeset 77273 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Feb 12, 2019 12:10:43 PM (6 years ago)
- svn:sync-xref-src-repo-rev:
- 128787
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/widgets/graphics/UIGraphicsScrollBar.cpp
r77268 r77273 48 48 49 49 /** Constructs graphics scroll-bar token passing @a pParent to the base-class. */ 50 UIGraphicsScrollBarToken(Q IGraphicsWidget *pParent = 0);50 UIGraphicsScrollBarToken(Qt::Orientation enmOrientation, QIGraphicsWidget *pParent = 0); 51 51 52 52 /** Returns minimum size-hint. */ … … 78 78 void updateExtent(); 79 79 80 /** Holds the orientation. */ 81 const Qt::Orientation m_enmOrientation; 82 80 83 /** Holds the scroll-bar extent. */ 81 84 int m_iExtent; … … 90 93 *********************************************************************************************************************************/ 91 94 92 UIGraphicsScrollBarToken::UIGraphicsScrollBarToken(Q IGraphicsWidget *pParent /* = 0 */)95 UIGraphicsScrollBarToken::UIGraphicsScrollBarToken(Qt::Orientation enmOrientation, QIGraphicsWidget *pParent /* = 0 */) 93 96 : QIGraphicsWidget(pParent) 97 , m_enmOrientation(enmOrientation) 94 98 , m_fHovered(false) 95 99 { … … 99 103 QSizeF UIGraphicsScrollBarToken::minimumSizeHint() const 100 104 { 101 return QSizeF(m_iExtent, m_iExtent); 105 /* Calculate minimum size-hint depending on orientation: */ 106 switch (m_enmOrientation) 107 { 108 #ifdef VBOX_WS_MAC 109 case Qt::Horizontal: return QSizeF(2 * m_iExtent, m_iExtent); 110 case Qt::Vertical: return QSizeF(m_iExtent, 2 * m_iExtent); 111 #else 112 case Qt::Horizontal: return QSizeF(m_iExtent, m_iExtent); 113 case Qt::Vertical: return QSizeF(m_iExtent, m_iExtent); 114 #endif 115 } 116 117 /* Call to base-class: */ 118 return QIGraphicsWidget::minimumSizeHint(); 102 119 } 103 120 … … 392 409 #ifdef VBOX_WS_MAC 393 410 const int iMin = 0; 394 const int iMax = size().width() - m_iExtent;411 const int iMax = size().width() - 2 * m_iExtent; 395 412 #else 396 413 const int iMin = m_iExtent; … … 409 426 #ifdef VBOX_WS_MAC 410 427 const int iMin = 0; 411 const int iMax = size().height() - m_iExtent;428 const int iMax = size().height() - 2 * m_iExtent; 412 429 #else 413 430 const int iMin = m_iExtent; … … 533 550 { 534 551 /* Create token: */ 535 m_pToken = new UIGraphicsScrollBarToken( this);552 m_pToken = new UIGraphicsScrollBarToken(m_enmOrientation, this); 536 553 if (m_pToken) 537 554 connect(m_pToken, &UIGraphicsScrollBarToken::sigMouseMoved, … … 668 685 #ifdef VBOX_WS_MAC 669 686 const int iMin = 0; 670 const int iMax = size().width() - m_iExtent;687 const int iMax = size().width() - 2 * m_iExtent; 671 688 #else 672 689 const int iMin = m_iExtent; … … 682 699 #ifdef VBOX_WS_MAC 683 700 const int iMin = 0; 684 const int iMax = size().height() - m_iExtent;701 const int iMax = size().height() - 2 * m_iExtent; 685 702 #else 686 703 const int iMin = m_iExtent; … … 717 734 QColor tokenColor = pal.color(QPalette::Active, QPalette::Window); 718 735 tokenColor.setAlpha(200); 736 #ifdef VBOX_WS_MAC 737 QRect tokenRectangle = QRect(actualTokenPosition(), QSize(m_iExtent, 2 * m_iExtent)); 738 #else 719 739 QRect tokenRectangle = QRect(actualTokenPosition(), QSize(m_iExtent, m_iExtent)); 740 #endif 720 741 tokenRectangle.setLeft(tokenRectangle.left() + .9 * tokenRectangle.width() * ((double)100 - m_iAnimatedValue) / 100); 721 742 pPainter->fillRect(tokenRectangle, tokenColor);
Note:
See TracChangeset
for help on using the changeset viewer.