Implement mouse wheel for sliders
ClosedPublic

Authored by astippich on Jul 8 2019, 6:48 PM.

Details

Summary

Enable seek and volume control when hovering the sliders in the MediaPlayerControl.
Seek value is hardcoded to 10 seconds, while volume is controlled in steps of 5.

BUG: 408704

Diff Detail

Repository
R255 Elisa
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
astippich requested review of this revision.Jul 8 2019, 6:48 PM
astippich created this revision.
astippich edited the summary of this revision. (Show Details)Jul 8 2019, 6:49 PM

+1, but I found two little issues:

  • The MouseArea's height is quite short, so it's hard to get the cursor into the right place. I would recommend making it span the full height of the player bar rather than simply just filling the area of the slider.
  • When scrolled, the handle's movement on the volume slider is instantaneous, but for the playback position slider it lags about half a second. This is not related to this patch here, but it making it scrollable makes this pre-existing issue more prominent.
astippich updated this revision to Diff 61428.Jul 9 2019, 4:51 PM
  • make MouseArea span the whole height

+1, but I found two little issues:

  • The MouseArea's height is quite short, so it's hard to get the cursor into the right place. I would recommend making it span the full height of the player bar rather than simply just filling the area of the slider.
  • When scrolled, the handle's movement on the volume slider is instantaneous, but for the playback position slider it lags about half a second. This is not related to this patch here, but it making it scrollable makes this pre-existing issue more prominent.

I have fixed the first issue. The second issue is a lot more difficult since the seeking and the volume change are working differently. The volume property of the actual audio player is bound to the slider value, while the seek works directly on the audio player and the slider is bound to the player. So the latter does a round trip. The fact that it is also done with two connected signals probably does not help.

ngraham accepted this revision.Jul 9 2019, 6:10 PM

Thanks, much better! Just one more little thing, then ship it.

src/qml/MediaPlayerControl.qml
311–312

No need to set all three of these; just do width: elisaTheme.volumeSliderWidth once

This revision is now accepted and ready to land.Jul 9 2019, 6:10 PM
This revision was automatically updated to reflect the committed changes.