From 5fb0779519e10aa20802945acb50e210572ec477 Mon Sep 17 00:00:00 2001 From: Slava Monich Date: Sun, 1 Nov 2020 17:07:33 +0200 Subject: [PATCH] [app] Fixed scrolling of storage view on SD card insertion It was producing strange results if contentX was non-zero --- app/qml/BooksStorageView.qml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/qml/BooksStorageView.qml b/app/qml/BooksStorageView.qml index a3dd9ef..2d2f816 100644 --- a/app/qml/BooksStorageView.qml +++ b/app/qml/BooksStorageView.qml @@ -250,9 +250,11 @@ SilicaFlickable { } function scrollToPage(index) { - dragScrollAnimation.from = contentX - dragScrollAnimation.to = (width + spacing) * index - dragScrollAnimation.start() + if (currentIndex !== index) { + dragScrollAnimation.from = contentX + dragScrollAnimation.to = contentX + (width + spacing) * (index - currentIndex) + dragScrollAnimation.start() + } } }