diff --git a/app/qml/BooksMainPage.qml b/app/qml/BooksMainPage.qml index f1614db..1b6cedc 100644 --- a/app/qml/BooksMainPage.qml +++ b/app/qml/BooksMainPage.qml @@ -40,8 +40,8 @@ Page { allowedOrientations: window.allowedOrientations - //property variant shelf property variant currentShelf: storageView.currentShelf + readonly property bool pageActive: status === PageStatus.Active property Item _bookView @@ -63,7 +63,7 @@ Page { opacity: book ? 1 : 0 visible: opacity > 0 orientation: root.orientation - pageActive: root.status === PageStatus.Active + pageActive: root.pageActive book: Settings.currentBook ? Settings.currentBook : null onCloseBook: Settings.currentBook = null Behavior on opacity { FadeAnimation {} } @@ -73,6 +73,7 @@ Page { BooksStorageView { id: storageView anchors.fill: parent + pageActive: root.pageActive opacity: Settings.currentBook ? 0 : 1 visible: opacity > 0 Behavior on opacity { FadeAnimation {} } diff --git a/app/qml/BooksStorageView.qml b/app/qml/BooksStorageView.qml index 2d2f816..3e60b38 100644 --- a/app/qml/BooksStorageView.qml +++ b/app/qml/BooksStorageView.qml @@ -37,8 +37,10 @@ import harbour.books 1.0 SilicaFlickable { id: storageView + interactive: !dragInProgress + property bool pageActive property bool editMode: false signal openBook(var book) @@ -156,7 +158,12 @@ SilicaFlickable { // Show the contents of SD-card and let use know that he can switch // between the internal memory and the removable storage by swiping // the list horizontally - onNewStorage: storageList.scrollToPage(index) + onNewStorage: { + if (pageActive && storageView.visible) { + console.log("showing SD card contents") + storageList.scrollToPage(index) + } + } } ListWatcher {