Show scrollbars for a few seconds at first

Lets the user know that there's content to scroll.
This commit is contained in:
miruka
2020-08-19 09:36:52 -04:00
parent 11def5c99f
commit 21fbe7a96b
8 changed files with 21 additions and 8 deletions

View File

@@ -11,6 +11,7 @@ Flickable {
ScrollBar.vertical: HScrollBar {
visible: parent.interactive
z: 999
flickableMoving: flickable.moving
}
Component.onCompleted: {

View File

@@ -84,6 +84,7 @@ GridView {
ScrollBar.vertical: HScrollBar {
visible: gridView.interactive
flickableMoving: gridView.moving
}
// property bool debug: false

View File

@@ -100,6 +100,7 @@ ListView {
}
ScrollBar.vertical: HScrollBar {
flickableMoving: listView.moving
visible: listView.interactive
}

View File

@@ -6,6 +6,8 @@ import QtQuick.Controls 2.12
ScrollBar {
id: scrollBar
property bool flickableMoving
minimumSize: (Math.min(height / 1.5, 48) * theme.uiScale) / height
opacity: size < 1 && (active || hovered) ? 1 : 0
padding: 0
@@ -34,5 +36,18 @@ ScrollBar {
}
}
Behavior on opacity { HNumberAnimation {} }
onFlickableMovingChanged: if (flickableMoving) activeOverride.when = false
Behavior on opacity { HNumberAnimation { factor: 2 } }
Binding on active {
id: activeOverride
value: initialVisibilityTimer.running
}
Timer {
id: initialVisibilityTimer
interval: window.settings.autoHideScrollBarsAfterMsec
running: scrollBar.size < 1
}
}

View File

@@ -11,6 +11,5 @@ ScrollView {
x: scrollView.mirrored ? 0 : scrollView.width - width
y: scrollView.topPadding
height: scrollView.availableHeight
active: scrollView.ScrollBar.horizontal.active
}
}