VirtualBox

Changeset 77203 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Feb 7, 2019 5:06:17 PM (6 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
128703
Message:

FE/Qt: bugref:9373: A bit of cleanup/rework for UIGraphicsScrollArea & UIGraphicsScrollBar for better scrolling experience.

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

    r77156 r77203  
    117117            {
    118118                if (angleDelta.x() > 0)
    119                     m_pScrollBar->setValue(m_pScrollBar->value() - m_pScrollBar->wheelStep());
    120                 else
    121                     m_pScrollBar->setValue(m_pScrollBar->value() + m_pScrollBar->wheelStep());
     119                    m_pScrollBar->setValue(m_pScrollBar->value() - m_pScrollBar->step());
     120                else
     121                    m_pScrollBar->setValue(m_pScrollBar->value() + m_pScrollBar->step());
    122122                break;
    123123            }
     
    126126            {
    127127                if (angleDelta.y() > 0)
    128                     m_pScrollBar->setValue(m_pScrollBar->value() - m_pScrollBar->wheelStep());
    129                 else
    130                     m_pScrollBar->setValue(m_pScrollBar->value() + m_pScrollBar->wheelStep());
     128                    m_pScrollBar->setValue(m_pScrollBar->value() - m_pScrollBar->step());
     129                else
     130                    m_pScrollBar->setValue(m_pScrollBar->value() + m_pScrollBar->step());
    131131                break;
    132132            }
     
    171171    if (m_pScrollBar)
    172172    {
     173        m_pScrollBar->setStep(10);
    173174        m_pScrollBar->setZValue(1);
    174175        connect(m_pScrollBar, &UIGraphicsScrollBar::sigValueChanged,
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/graphics/UIGraphicsScrollBar.cpp

    r77155 r77203  
    191191}
    192192
    193 int UIGraphicsScrollBar::wheelStep() const
    194 {
    195     return 10 * step();
    196 }
    197 
    198193void UIGraphicsScrollBar::setMinimum(int iMinimum)
    199194{
     
    269264    /* Call to base-class: */
    270265    QIGraphicsWidget::mousePressEvent(pEvent);
     266
     267    /* Mark event accepted so that it couldn't
     268     * influence underlying widgets: */
     269    pEvent->accept();
    271270
    272271    /* Redirect to token move handler: */
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/graphics/UIGraphicsScrollBar.h

    r77155 r77203  
    5555    /** Returns scrolling step. */
    5656    int step() const;
    57     /** Returns scrolling wheel step. */
    58     int wheelStep() const;
    5957
    6058    /** Defines @a iMinimum scroll-bar value. */
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette