[app] Tweaked book opening and closing animations

This commit is contained in:
Slava Monich 2021-11-13 21:09:07 +02:00
parent c430b8cf69
commit da9f682081
3 changed files with 11 additions and 6 deletions

View file

@ -63,7 +63,7 @@ Item {
{ pager: true, page: true, title: true, tools: true }
]
property alias viewInteractive: bookView.interactive
property bool viewInteractive: bookView.interactive && !loading
property alias pullDownMenu: menu
property alias loadingBackgroundOpacity: loadingBackground.opacity
property bool isCurrentView
@ -147,7 +147,7 @@ Item {
PullDownMenu {
id: menu
visible: isCurrentView && Settings.bookPullDownMenu
visible: isCurrentView && !loading && Settings.bookPullDownMenu
property real backToLibrary

View file

@ -1,6 +1,6 @@
/*
Copyright (C) 2015-2020 Jolla Ltd.
Copyright (C) 2015-2020 Slava Monich <slava.monich@jolla.com>
Copyright (C) 2015-2021 Jolla Ltd.
Copyright (C) 2015-2021 Slava Monich <slava.monich@jolla.com>
You may use this file under the terms of BSD license as follows:
@ -85,6 +85,7 @@ Page {
width: page.width
height: page.height
y: Settings.currentBook ? flickable.contentY : 0
viewScale: 0.9 + 0.1 * opacity
pageActive: page.pageActive
isCurrentView: currentView === storageView
opacity: Settings.currentBook ? ((y > fadeInThreshold) ? 1 : (y > 0) ? y/fadeInThreshold : 0) : 1
@ -139,7 +140,7 @@ Page {
property: "contentY"
to: page.height
duration: 150
easing.type: Easing.InQuad
easing.type: Easing.Linear
}
ScriptAction {
script: {

View file

@ -39,6 +39,7 @@ Item {
id: storageView
property alias viewInteractive: storageList.interactive
property alias viewScale: storageList.scale
property alias pullDownMenu: menu
property alias isCurrentView: menu.visible
property bool pageActive
@ -189,7 +190,9 @@ Item {
SilicaListView {
id: storageList
anchors.fill: parent
anchors.centerIn: parent
width: parent.width
height: parent.height
model: storageModel
flickDeceleration: maximumFlickVelocity
orientation: ListView.Horizontal
@ -235,6 +238,7 @@ Item {
device: model.device
removableStorage: model.removable
shelfIndex: model.index
view.clip: storageList.scale == 1
onStartEditing: storageView.editMode = true
onStopEditing: storageView.editMode = false
onScrollLeft: storageList.scrollOnePageLeft()