initial scroll position saving
This commit is contained in:
3 files changed
+88
-25
No files matched your search
+17
-25
@@ -17,6 +17,7 @@ ApplicationWindow {
|
||||
|
||||
property bool sidebarOpen: false
|
||||
property string currentPage: "starter"
|
||||
property string pageFlipMode: "scroll" // "scroll" | "page"
|
||||
|
||||
Row {
|
||||
anchors.fill: parent
|
||||
@@ -28,11 +29,9 @@ ApplicationWindow {
|
||||
onCloseDrawer: window.sidebarOpen = false
|
||||
onNavigateTo: function(page) {
|
||||
window.currentPage = page
|
||||
window.sidebarOpen = false
|
||||
}
|
||||
onOpenFile: {
|
||||
bookController.browseAndOpen()
|
||||
window.sidebarOpen = false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,16 +47,24 @@ ApplicationWindow {
|
||||
onMenuClicked: window.sidebarOpen = true
|
||||
}
|
||||
|
||||
Loader {
|
||||
id: contentLoader
|
||||
Item {
|
||||
id: contentArea
|
||||
width: parent.width
|
||||
height: parent.height - header.height - (footerLoader.active ? Theme.footerHeight : 0)
|
||||
sourceComponent: {
|
||||
switch (window.currentPage) {
|
||||
case "reader": return readerComponent
|
||||
case "settings": return settingsComponent
|
||||
default: return starterComponent
|
||||
}
|
||||
|
||||
StarterPage {
|
||||
anchors.fill: parent
|
||||
visible: window.currentPage !== "reader" && window.currentPage !== "settings"
|
||||
}
|
||||
|
||||
ReaderPage {
|
||||
anchors.fill: parent
|
||||
visible: window.currentPage === "reader"
|
||||
}
|
||||
|
||||
SettingsPage {
|
||||
anchors.fill: parent
|
||||
visible: window.currentPage === "settings"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -70,21 +77,6 @@ ApplicationWindow {
|
||||
}
|
||||
}
|
||||
|
||||
Component {
|
||||
id: starterComponent
|
||||
StarterPage {}
|
||||
}
|
||||
|
||||
Component {
|
||||
id: readerComponent
|
||||
ReaderPage {}
|
||||
}
|
||||
|
||||
Component {
|
||||
id: settingsComponent
|
||||
SettingsPage {}
|
||||
}
|
||||
|
||||
ErrorPopup {
|
||||
anchors.fill: parent
|
||||
z: 3000
|
||||
|
||||
Reference in new issue
Block a user