Refactor user_files module & add live reloading

- Cleaner design for the backend user_files classes and simplified
  interaction with QML
- Config and theme files will now automatically reload when changed on
  disk
- Removed manual reload keybind and button
This commit is contained in:
miruka
2020-10-05 03:06:07 -04:00
parent 00c468384a
commit 75fbf23b21
13 changed files with 249 additions and 230 deletions

View File

@@ -28,41 +28,18 @@ Item {
readonly property alias debugConsole: debugConsole
readonly property alias mainPane: mainPane
readonly property alias pageLoader: pageLoader
readonly property alias pressAnimation: pressAnimation
readonly property alias fontMetrics: fontMetrics
readonly property alias idleManager: idleManager
function reloadSettings() {
py.loadSettings(() => {
image.reload()
mainUI.pressAnimation.start()
})
}
focus: true
Component.onCompleted: window.mainUI = mainUI
SequentialAnimation {
id: pressAnimation
HNumberAnimation {
target: mainUI; property: "scale"; from: 1.0; to: 0.9
}
HNumberAnimation {
target: mainUI; property: "scale"; from: 0.9; to: 1.0
}
}
HShortcut {
sequences: window.settings.keys.startPythonDebugger
onActivated: py.call("BRIDGE.pdb")
}
HShortcut {
sequences: window.settings.keys.reloadConfig
onActivated: reloadSettings()
}
HShortcut {
sequences: window.settings.keys.zoomIn
onActivated: {