restore opened file and position
This commit is contained in:
12 files changed
+491
-11
No files matched your search
+29
-1
@@ -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
|
||||
|
||||
Reference in new issue
Block a user