Changeset 79389 in vbox for trunk/src/VBox
- Timestamp:
- Jun 27, 2019 12:30:53 PM (6 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/widgets/graphics
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/widgets/graphics/UIGraphicsScrollArea.cpp
r78008 r79389 167 167 { 168 168 if (angleDelta.x() > 0) 169 #ifdef VBOX_WS_MAC 170 m_pScrollBar->setValue(m_pScrollBar->value() - pixelDelta.y()); 171 #else 169 172 m_pScrollBar->setValue(m_pScrollBar->value() - m_pScrollBar->step()); 173 #endif 170 174 else if (angleDelta.x() < 0) 175 #ifdef VBOX_WS_MAC 176 m_pScrollBar->setValue(m_pScrollBar->value() - pixelDelta.y()); 177 #else 171 178 m_pScrollBar->setValue(m_pScrollBar->value() + m_pScrollBar->step()); 179 #endif 172 180 break; 173 181 } … … 229 237 if (m_pScrollBar) 230 238 { 231 m_pScrollBar->setStep(10);232 239 m_pScrollBar->setZValue(1); 233 240 connect(m_pScrollBar, &UIGraphicsScrollBar::sigValueChanged, -
trunk/src/VBox/Frontends/VirtualBox/src/widgets/graphics/UIGraphicsScrollBar.cpp
r77290 r79389 208 208 : m_enmOrientation(enmOrientation) 209 209 , m_iExtent(-1) 210 , m_iStep(1)211 210 , m_iMinimum(0) 212 211 , m_iMaximum(100) … … 234 233 , m_enmOrientation(enmOrientation) 235 234 , m_iExtent(-1) 236 , m_iStep(1)237 235 , m_iMinimum(0) 238 236 , m_iMaximum(100) … … 268 266 } 269 267 270 void UIGraphicsScrollBar::setStep(int iStep)271 {272 m_iStep = iStep;273 }274 275 268 int UIGraphicsScrollBar::step() const 276 269 { 277 return m_iStep;270 return 2 * QApplication::style()->pixelMetric(QStyle::PM_SmallIconSize); 278 271 } 279 272 … … 453 446 void UIGraphicsScrollBar::sltButton1Clicked() 454 447 { 455 setValue(value() - m_iStep);448 setValue(value() - step()); 456 449 } 457 450 458 451 void UIGraphicsScrollBar::sltButton2Clicked() 459 452 { 460 setValue(value() + m_iStep);453 setValue(value() + step()); 461 454 } 462 455 -
trunk/src/VBox/Frontends/VirtualBox/src/widgets/graphics/UIGraphicsScrollBar.h
r77290 r79389 67 67 virtual QSizeF minimumSizeHint() const /* override */; 68 68 69 /** Defines scrolling @a iStep. */70 void setStep(int iStep);71 69 /** Returns scrolling step. */ 72 70 int step() const; … … 186 184 int m_iExtent; 187 185 188 /** Holds the scrolling step. */189 int m_iStep;190 191 186 /** Holds the minimum scroll-bar value. */ 192 187 int m_iMinimum;
Note:
See TracChangeset
for help on using the changeset viewer.