[app] Fixed a problem with paging animation

This commit is contained in:
Slava Monich 2018-07-23 22:51:47 +03:00
parent 5a765e391f
commit be2b66f955

View file

@ -58,7 +58,7 @@ SilicaFlickable {
{ pager: true, page: true, title: true, tools: true } { pager: true, page: true, title: true, tools: true }
] ]
interactive: !selecting && interactive: !selecting && !scrollAnimation.running &&
(!linkMenu || !linkMenu.visible) && (!linkMenu || !linkMenu.visible) &&
(!imageView || !imageView.visible) && (!imageView || !imageView.visible) &&
(!footnoteView || !footnoteView.visible) (!footnoteView || !footnoteView.visible)
@ -146,14 +146,12 @@ SilicaFlickable {
property bool completed property bool completed
Component.onCompleted: { Component.onCompleted: {
//console.log(currentPage)
bookViewWatcher.positionViewAtIndex(currentPage) bookViewWatcher.positionViewAtIndex(currentPage)
completed = true completed = true
} }
onCurrentPageChanged: { onCurrentPageChanged: {
//console.log(currentPage, completed, flicking) if (completed && !flicking && !scrollAnimation.running) {
if (completed && !flicking) {
bookViewWatcher.positionViewAtIndex(currentPage) bookViewWatcher.positionViewAtIndex(currentPage)
} }
} }
@ -169,13 +167,11 @@ SilicaFlickable {
listView: bookView listView: bookView
onCurrentIndexChanged: { onCurrentIndexChanged: {
if (listView.completed && !listView.flicking && currentIndex >= 0) { if (listView.completed && !listView.flicking && currentIndex >= 0) {
//console.log(currentIndex, listView.completed, listView.flicking)
updateModel() updateModel()
} }
} }
function updateModel() { function updateModel() {
hideViews() hideViews()
//console.trace()
stackModel.currentPage = currentIndex stackModel.currentPage = currentIndex
if (!pager.pressed) { if (!pager.pressed) {
pager.currentPage = currentIndex pager.currentPage = currentIndex