ScrollBars and ScrollView - add 'isDragged' or 'isScrolling' property

Bug #1627078 reported by Stefano Verzegnassi
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ubuntu-ui-toolkit (Ubuntu)
New
Undecided
Unassigned

Bug Description

I'm trying to implement a "page indicator" to be shown when the user scrolls a Flickable using a UITK ScrollBar. The idea is to mimic a feature available in Adobe Reader for Android.

i.e. http://imgur.com/a/OzjYG

In order to do this, I have to access the "draggingThumb" property of the style instance of a UITK ScrollBar, which is meant to be private.

Item {
    [...]
    visible: scrollView.verticalScrollbar.__styleInstance.draggingThumb
}

What it could be useful is to expose this property directly in the ScrollBar.
Using the Flickable properties for this purpose would be a bit complicated, since it wouldn't be desiderable to see such overlay during an "ordinary" touch/flick event.

Revision history for this message
Andrea Bernabei (faenil) wrote :

Hi Stefano,

thank you for this report. I'll bring this up with the SDK team and see if we can "afford" providing (which means guaranteeing future compatibility for) that property ;)

Can you please ping me again on Monday about this?

Revision history for this message
Tim Peeters (tpeeters) wrote :

Would there be any other ways to show the overlay? For example by flicking the Flickable really fast? Then maybe it is better to use a property of the flickable.

Also, to keep the APIs consistent, maybe there should be property 'pressed' which is similar to MouseArea.pressed. Also, we can have a look at the API for QtQuickControls 2 Scrollbar, which has a 'pressed' and 'active' property: http://doc.qt.io/qt-5/qml-qtquick-controls2-scrollbar.html

Revision history for this message
Tim Peeters (tpeeters) wrote :

^ Using the API of QQC2 Scrollbar you can accomplish what you want. In onPositionChanged, you can check if 'pressed' is true and then enable the overlay. You can hide the overlay again when pressed becomes false.

Revision history for this message
Stefano Verzegnassi (verzegnassi-stefano) wrote :

@Andrea - Sure, no problem! ;)

@Tim - Yes, checking for e.g. 'verticalVelocity' property of the Flickable could accomplish it. QQC2 are not provided with the Ubuntu UI Toolkit and they are available only with Qt 5.7, so I would prefer a solution which can be easily integrated in a Ubuntu convergent app.

I'll have a try checking for the velocity of the flick action, since it may be desiderable to show such overlay for any 'fast-scroll' event.

However, I wanted to provide an example why such property could be useful also for UITK ScrollBars. Calling it 'pressed' for consistence sounds good to me.

Thank you guys for the fast reply, have a great weekend!

Revision history for this message
Zsombor Egri (zsombi) wrote :

For teh sake of QQC2 compatibility, let's call the property 'pressed'. Scrollbars are exposed by ScrollView, so there's no need to expose there anything.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.