Zoomable scrollbar
-
I'm building an audio editor which requires a zoomable scrollbar in the timeline so the user can zoom in and out. My approach is to build a custom scrollbar where the user can expand and stretch the slider in order to zoom in and out, in a similar way to other DAWs:
Any tips on how to handle the event of stretching/expanding from the ends of the slider and resizing it?
-
Hi,
By zoomable, do you mean it should get its min and max values adjusted by a zoom factor ?
-
I guess so. The range of the scrollbar would change depending on how long the slider is. However, the event that I don't know how to get is when the mouse is over the ends of the slider so the user can change its length and so the range of the scrollbar (min/max values).
-
I may have misunderstood how you want your UI to work.
Can you describe the steps your users should do ?
-
The scrollbar that I'm trying to implement will be able to change the scale / zoom of a timeline.
When opening the app, the scrollbar's default setup will be the slider occupying the full length of the scrollbar, like this:
The user will be able to stretch the slider from the ends of it and that would change the scale / zoom of the viewport, and so change the size of the slider within the scrollbar, like this:
https://drive.google.com/file/d/1La-XbdSxtcz7S47fQKRS4SPx1-gsPFpp/view?usp=share_link
Hopefully, with this demo video is easier to understand my goal. Thanks for your help!
-
Way clearer ! Thanks
Then I think you will have to go from QAbstractSlider and implement a custom handle that you can resize and when that occurs adjust the max value of your slider.