make UI look snappier than it is on (by making loading less noticable)

This commit is contained in:
Agel committed 2026-04-08 16:00:04 +02:00
1 parent a54312a397
commit 503324e7e3
3 files changed
+38 -2

No files matched your search

+18 -1
View File
@@ -23,6 +23,7 @@ ApplicationWindow {
property bool barsVisible: true
// Set to true on the first book open at startup so we restore the last page.
property bool _startupRestore: false
property bool _bookInitializing: false
onCurrentPageChanged: uiState.lastPage = currentPage
@@ -46,6 +47,20 @@ ApplicationWindow {
}
}
Connections {
target: book
function onLoadingChanged() {
if (book.loading) window._bookInitializing = true
}
}
Connections {
target: readingModel
function onMeasuringChanged() {
if (!readingModel.measuring) window._bookInitializing = false
}
}
Timer {
id: geometrySaveTimer
interval: 250
@@ -123,10 +138,12 @@ ApplicationWindow {
BusyIndicator {
anchors.centerIn: parent
running: book.loading || readingModel.measuring
running: window._bookInitializing
visible: running
z: 10
}
}
Loader {
+19
View File
@@ -13,6 +13,25 @@ Rectangle {
anchors.top: parent.top
}
// Measuring spinner
Text {
anchors.left: parent.left
anchors.leftMargin: 16
anchors.verticalCenter: parent.verticalCenter
visible: typeof readingModel !== "undefined" && readingModel.measuring
text: "\ue863"
font.family: "Material Icons Outlined"
font.pixelSize: 14
color: ThemeManager.currentTheme.dimText
RotationAnimator on rotation {
from: 0; to: 360
duration: 1200
loops: Animation.Infinite
running: parent.visible
}
}
// Prev chapter button
Button {
id: prevBtn