add library with reading history, progress tracking, and view persistence

This commit is contained in:
Agel committed 2026-03-20 11:20:16 +01:00
1 parent c62733bc26
commit c4046d8533
15 files changed
+685 -40

No files matched your search

+20 -1
View File
@@ -19,6 +19,8 @@ ApplicationWindow {
property string currentPage: "starter"
property string pageFlipMode: appState.pageFlipMode
onCurrentPageChanged: appState.lastPage = currentPage
Component.onCompleted: {
width = appState.windowWidth
height = appState.windowHeight
@@ -28,6 +30,9 @@ ApplicationWindow {
}
if (appState.lastFilePath !== "")
bookController.openBook(appState.lastFileUrl())
var savedPage = appState.lastPage
if (savedPage === "library" || savedPage === "settings")
window.currentPage = savedPage
}
Timer {
@@ -57,10 +62,15 @@ ApplicationWindow {
onCloseDrawer: window.sidebarOpen = false
onNavigateTo: function(page) {
window.currentPage = page
window.sidebarOpen = false
}
onOpenFile: {
bookController.browseAndOpen()
}
onCloseBook: {
bookController.closeBook()
window.sidebarOpen = false
}
}
Column {
@@ -82,7 +92,7 @@ ApplicationWindow {
StarterPage {
anchors.fill: parent
visible: window.currentPage !== "reader" && window.currentPage !== "settings"
visible: window.currentPage === "starter"
}
ReaderPage {
@@ -94,6 +104,11 @@ ApplicationWindow {
anchors.fill: parent
visible: window.currentPage === "settings"
}
LibraryPage {
anchors.fill: parent
visible: window.currentPage === "library"
}
}
Loader {
@@ -115,5 +130,9 @@ ApplicationWindow {
function onBookReady() {
window.currentPage = "reader"
}
function onBookChanged() {
if (!bookController.hasBook && window.currentPage === "reader")
window.currentPage = "starter"
}
}
}