Improve main pane list reactions to mouse events
This commit is contained in:
parent
e86c5d7163
commit
ba955008fc
|
@ -54,6 +54,7 @@ HTileDelegate {
|
|||
"AccountSettings/AccountSettings", { "userId": model.id }
|
||||
)
|
||||
mainPaneList.detachedCurrentIndex = false
|
||||
mainPaneList.centerToHighlight = false
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -150,6 +150,7 @@ HTileDelegate {
|
|||
onActivated: {
|
||||
pageLoader.showRoom(userId, model.id)
|
||||
mainPaneList.detachedCurrentIndex = false
|
||||
mainPaneList.centerToHighlight = false
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user