restore opened file and position

This commit is contained in:
Agel committed 2026-03-16 15:34:15 +01:00
1 parent fcacd0495d
commit 2ecf9f4178
12 files changed
+491 -11

No files matched your search

+29 -1
View File
@@ -17,7 +17,35 @@ ApplicationWindow {
property bool sidebarOpen: false
property string currentPage: "starter"
property string pageFlipMode: "scroll" // "scroll" | "page"
property string pageFlipMode: appState.pageFlipMode
Component.onCompleted: {
width = appState.windowWidth
height = appState.windowHeight
if (appState.windowX >= 0 && appState.windowY >= 0) {
x = appState.windowX
y = appState.windowY
}
if (appState.lastFilePath !== "")
bookController.openBook(appState.lastFileUrl())
}
Timer {
id: geometrySaveTimer
interval: 500
repeat: false
onTriggered: {
appState.setWindowWidth(window.width)
appState.setWindowHeight(window.height)
appState.setWindowX(window.x)
appState.setWindowY(window.y)
}
}
onWidthChanged: geometrySaveTimer.restart()
onHeightChanged: geometrySaveTimer.restart()
onXChanged: geometrySaveTimer.restart()
onYChanged: geometrySaveTimer.restart()
Row {
anchors.fill: parent