diff --git a/app/qml/BooksBookView.qml b/app/qml/BooksBookView.qml index d4785e0..98ecd06 100644 --- a/app/qml/BooksBookView.qml +++ b/app/qml/BooksBookView.qml @@ -134,6 +134,8 @@ Item { PullDownMenu { id: menu + visible: false // BooksMainPage will make it visible when it's needed + MenuItem { //: Pulley menu item //% "Settings" diff --git a/app/qml/BooksMainPage.qml b/app/qml/BooksMainPage.qml index 06cb593..85d9603 100644 --- a/app/qml/BooksMainPage.qml +++ b/app/qml/BooksMainPage.qml @@ -47,23 +47,26 @@ Page { Component.onCompleted: createBookViewIfNeeded() - onCurrentViewChanged: setPullDownMenu(currentView ? currentView.pullDownMenu : null) + onCurrentViewChanged: updatePullDownMenu() function createBookViewIfNeeded() { if (Settings.currentBook && !bookView) { bookView = bookViewComponent.createObject(flickable.contentItem) + updatePullDownMenu() } } - function setPullDownMenu(menu) { + function updatePullDownMenu() { + var menu = currentView ? currentView.pullDownMenu : null + if (menu) { + menu.visible = true + } if (flickable.pullDownMenu !== menu) { - if (flickable.pullDownMenu) { - flickable.pullDownMenu.visible = false - } - if (menu) { - menu.visible = true - } + var prevMenu = flickable.pullDownMenu flickable.pullDownMenu = menu + if (prevMenu) { + prevMenu.visible = false + } } } @@ -74,7 +77,7 @@ Page { Connections { target: currentView - onPullDownMenuChanged: setPullDownMenu(currentView.pullDownMenu) + onPullDownMenuChanged: updatePullDownMenu() } SilicaFlickable { @@ -83,7 +86,6 @@ Page { anchors.fill: parent flickableDirection: Flickable.VerticalFlick interactive: currentView && currentView.viewInteractive - pullDownMenu: currentView ? currentView.pullDownMenu : null BooksStorageView { id: storageView diff --git a/app/qml/BooksStorageView.qml b/app/qml/BooksStorageView.qml index fe12f92..d1ec6d3 100644 --- a/app/qml/BooksStorageView.qml +++ b/app/qml/BooksStorageView.qml @@ -96,6 +96,8 @@ Item { PullDownMenu { id: menu + visible: false // BooksMainPage will make it visible when it's needed + MenuItem { //: Pulley menu item //% "Settings"