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 }
|
"AccountSettings/AccountSettings", { "userId": model.id }
|
||||||
)
|
)
|
||||||
mainPaneList.detachedCurrentIndex = false
|
mainPaneList.detachedCurrentIndex = false
|
||||||
|
mainPaneList.centerToHighlight = false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -55,18 +55,21 @@ HListView {
|
||||||
value: highlightRectangle.y + highlightRectangle.height / 2 -
|
value: highlightRectangle.y + highlightRectangle.height / 2 -
|
||||||
mainPaneList.height / 2
|
mainPaneList.height / 2
|
||||||
delayed: true
|
delayed: true
|
||||||
when: yAnimation.running
|
when: centerToHighlight && yAnimation.running
|
||||||
}
|
}
|
||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: mainPaneList
|
target: mainPaneList
|
||||||
enabled: yAnimation.running
|
enabled: centerToHighlight && yAnimation.running
|
||||||
onContentYChanged: mainPaneList.returnToBounds()
|
onContentYChanged: mainPaneList.returnToBounds()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onMovingChanged: if (moving) centerToHighlight = false
|
||||||
|
|
||||||
|
|
||||||
property bool detachedCurrentIndex: false
|
property bool detachedCurrentIndex: false
|
||||||
|
property bool centerToHighlight: false
|
||||||
|
|
||||||
readonly property Room selectedRoom:
|
readonly property Room selectedRoom:
|
||||||
currentItem ? currentItem.roomList.currentItem : null
|
currentItem ? currentItem.roomList.currentItem : null
|
||||||
|
@ -83,6 +86,7 @@ HListView {
|
||||||
|
|
||||||
|
|
||||||
function previous() {
|
function previous() {
|
||||||
|
centerToHighlight = true
|
||||||
detachedCurrentIndex = true
|
detachedCurrentIndex = true
|
||||||
|
|
||||||
if (! mainPane.filter) {
|
if (! mainPane.filter) {
|
||||||
|
@ -129,6 +133,7 @@ HListView {
|
||||||
}
|
}
|
||||||
|
|
||||||
function next() {
|
function next() {
|
||||||
|
centerToHighlight = true
|
||||||
detachedCurrentIndex = true
|
detachedCurrentIndex = true
|
||||||
|
|
||||||
if (! mainPane.filter) {
|
if (! mainPane.filter) {
|
||||||
|
@ -226,6 +231,12 @@ HListView {
|
||||||
when: ! detachedCurrentIndex
|
when: ! detachedCurrentIndex
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TapHandler {
|
||||||
|
id: tapHandler
|
||||||
|
property var pr: active
|
||||||
|
onPrChanged: print("pr changed:", pr)
|
||||||
|
}
|
||||||
|
|
||||||
Timer {
|
Timer {
|
||||||
id: activateLimiter
|
id: activateLimiter
|
||||||
interval: 200
|
interval: 200
|
||||||
|
|
|
@ -150,6 +150,7 @@ HTileDelegate {
|
||||||
onActivated: {
|
onActivated: {
|
||||||
pageLoader.showRoom(userId, model.id)
|
pageLoader.showRoom(userId, model.id)
|
||||||
mainPaneList.detachedCurrentIndex = false
|
mainPaneList.detachedCurrentIndex = false
|
||||||
|
mainPaneList.centerToHighlight = false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user