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

@ -1,7 +1,6 @@
# TODO
- server list sorting method / explain what the % number is (stability)
- server list: make it more obvious that it can be scrolled
- clicking cancel on SSO "waiting" box doesn't do anything the first time
- spam alt+shift+a when starting app on server browser → segfault
- remove items.Device
@ -68,7 +67,6 @@
## Interface
- Colorize "@room" in messages
- Show scrollbars for a few seconds if there's content to scroll on when
opening a page or popup
- Device IP geolocation
- Can rooms but left with a reason?
@ -105,7 +103,6 @@
- Make room invite/left banner buttons look better
- Choose a better easing types for animations
- Make HListView scrollbars more visible
- In messages, remove the HTML lists excess left margin
- Improve UI for very small window heights

View File

@ -267,6 +267,7 @@ class UISettings(JSONDataFile):
"alertOnMentionForMsec": -1,
"alertOnMessageForMsec": 0,
"alwaysCenterRoomHeader": False,
"autoHideScrollBarsAfterMsec": 2000,
"beUnavailableAfterSecondsIdle": 60 * 10,
"compactMode": False,
"clearRoomFilterOnEnter": True,

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
}
}

View File

@ -128,9 +128,7 @@ HBox {
text.toLowerCase().trim().replace(/\/+$/, "")
inputMethodHints: Qt.ImhUrlCharactersOnly
defaultText: window.getState(
box, "acceptedUserUrl", "",
)
defaultText: window.getState(box, "acceptedUserUrl", "")
placeholderText: "example.org"
onTextEdited: {