Changeset 57215 in vbox
- Timestamp:
- Aug 6, 2015 1:17:02 PM (10 years ago)
- svn:sync-xref-src-repo-rev:
- 101967
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/extensions/QIAdvancedSlider.cpp
r57193 r57215 95 95 #endif /* Q_WS_MAC */ 96 96 97 /* Calculating half of tick-width as it is required to adjust the colors range geometry98 * for sliders which have tick-interval and single-step equal like CPU and Monitor count sliders.99 * It is used in below code to draw correct boundaries. */100 qreal dHalfTickWidth = 0;101 if (tickInterval() == singleStep())102 dHalfTickWidth = (qreal)ticks.width() / (maximum() - minimum()) / 2;103 104 97 if ((m_minOpt != -1 && 105 98 m_maxOpt != -1) && … … 108 101 int posMinOpt = QStyle::sliderPositionFromValue(opt.minimum, opt.maximum, m_minOpt, available); 109 102 int posMaxOpt = QStyle::sliderPositionFromValue(opt.minimum, opt.maximum, m_maxOpt, available); 110 p.fillRect(ticks.x() + posMinOpt, ticks.y(), posMaxOpt - posMinOpt + 1 + dHalfTickWidth, ticks.height(), m_optColor);103 p.fillRect(ticks.x() + posMinOpt, ticks.y(), posMaxOpt - posMinOpt + 1, ticks.height(), m_optColor); 111 104 } 112 105 if ((m_minWrn != -1 && … … 116 109 int posMinWrn = QStyle::sliderPositionFromValue(opt.minimum, opt.maximum, m_minWrn, available); 117 110 int posMaxWrn = QStyle::sliderPositionFromValue(opt.minimum, opt.maximum, m_maxWrn, available); 118 if (maximum() > m_maxWrn) 119 p.fillRect(ticks.x() + posMinWrn + dHalfTickWidth, ticks.y(), posMaxWrn - posMinWrn + 1, ticks.height(), m_wrnColor); 120 else 121 p.fillRect(ticks.x() + posMinWrn + dHalfTickWidth, ticks.y(), posMaxWrn - posMinWrn + 1 - dHalfTickWidth, ticks.height(), m_wrnColor); 111 p.fillRect(ticks.x() + posMinWrn, ticks.y(), posMaxWrn - posMinWrn + 1, ticks.height(), m_wrnColor); 122 112 } 123 113 if ((m_minErr != -1 && … … 127 117 int posMinErr = QStyle::sliderPositionFromValue(opt.minimum, opt.maximum, m_minErr, available); 128 118 int posMaxErr = QStyle::sliderPositionFromValue(opt.minimum, opt.maximum, m_maxErr, available); 129 p.fillRect(ticks.x() + posMinErr + dHalfTickWidth, ticks.y(), posMaxErr - posMinErr + 1 - dHalfTickWidth, ticks.height(), m_errColor);119 p.fillRect(ticks.x() + posMinErr, ticks.y(), posMaxErr - posMinErr + 1, ticks.height(), m_errColor); 130 120 } 131 121 p.end();
Note:
See TracChangeset
for help on using the changeset viewer.