Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

plugin-volume: add support for hires wheel #1856

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Commits on Jan 12, 2023

  1. Allow to change the volume using a mouse hires wheel

    The Volume control plugin allows to change the volume using
    the mouse wheel. However for hires wheel this doesn't work.
    
    The volume change is controlled by the following formula:
    
     m_volumeSlider->setSliderPosition(m_volumeSlider->sliderPosition()
       + (event->angleDelta().y() / QWheelEvent::DefaultDeltasPerStep *
       m_volumeSlider->singleStep()));
    
    For some kind of mouse where the wheel event is compose by a lot
    of small 'delta'; the ratio
    
       event->angleDelta().y() / QWheelEvent::DefaultDeltasPerStep
    
    is less than 1; and because this ratio is between two integers
    it is rounded to 0.
    
    So store the fraction part of the wheel stroke in a static variable.
    kreijack committed Jan 12, 2023
    Configuration menu
    Copy the full SHA
    195978b View commit details
    Browse the repository at this point in the history