Improve main pane list reactions to mouse events

This commit is contained in:
miruka 2020-03-19 04:23:09 -04:00
parent e86c5d7163
commit ba955008fc
3 changed files with 15 additions and 2 deletions

View File

@ -54,6 +54,7 @@ HTileDelegate {
"AccountSettings/AccountSettings", { "userId": model.id }
)
mainPaneList.detachedCurrentIndex = false
mainPaneList.centerToHighlight = false
}

View File

@ -55,18 +55,21 @@ HListView {
value: highlightRectangle.y + highlightRectangle.height / 2 -
mainPaneList.height / 2
delayed: true
when: yAnimation.running
when: centerToHighlight && yAnimation.running
}
Connections {
target: mainPaneList
enabled: yAnimation.running
enabled: centerToHighlight && yAnimation.running
onContentYChanged: mainPaneList.returnToBounds()
}
}
onMovingChanged: if (moving) centerToHighlight = false
property bool detachedCurrentIndex: false
property bool centerToHighlight: false
readonly property Room selectedRoom:
currentItem ? currentItem.roomList.currentItem : null
@ -83,6 +86,7 @@ HListView {
function previous() {
centerToHighlight = true
detachedCurrentIndex = true
if (! mainPane.filter) {
@ -129,6 +133,7 @@ HListView {
}
function next() {
centerToHighlight = true
detachedCurrentIndex = true
if (! mainPane.filter) {
@ -226,6 +231,12 @@ HListView {
when: ! detachedCurrentIndex
}
TapHandler {
id: tapHandler
property var pr: active
onPrChanged: print("pr changed:", pr)
}
Timer {
id: activateLimiter
interval: 200

View File

@ -150,6 +150,7 @@ HTileDelegate {
onActivated: {
pageLoader.showRoom(userId, model.id)
mainPaneList.detachedCurrentIndex = false
mainPaneList.centerToHighlight = false
}