[app] Tweaking look loading UI

This commit is contained in:
Slava Monich 2020-11-03 05:13:33 +02:00
parent cf51192137
commit a39ad381b0
2 changed files with 10 additions and 1 deletions

View file

@ -66,6 +66,7 @@ Item {
property alias viewInteractive: bookView.interactive
property alias pullDownMenu: menu
property alias isCurrentView: menu.visible
property alias loadingBackgroundOpacity: loadingBackground.opacity
property bool pageActive
readonly property bool viewActive: pageActive && Qt.application.active && book
@ -214,6 +215,13 @@ Item {
}
}
Rectangle {
id: loadingBackground
anchors.fill: parent
color: HarbourTheme.invertedPrimaryColor
visible: loading && opacity > 0
}
SilicaListView {
id: bookView
@ -223,7 +231,7 @@ Item {
orientation: ListView.Horizontal
snapMode: ListView.SnapOneItem
preferredHighlightBegin: 0
preferredHighlightEnd: width + spacing
preferredHighlightEnd: width
highlightRangeMode: ListView.StrictlyEnforceRange
spacing: Theme.paddingMedium
opacity: loading ? 0 : 1

View file

@ -123,6 +123,7 @@ Page {
isCurrentView: currentView === bookView
pageActive: page.pageActive
book: Settings.currentBook ? Settings.currentBook : null
loadingBackgroundOpacity: HarbourTheme.opacityOverlay * storageView.opacity
onCloseBook: Settings.currentBook = null
onVisibleChanged: if (visible) opacity = 1