HNumberAnimation component for standard duration

This commit is contained in:
miruka 2019-07-06 17:42:04 -04:00
parent 7b92264ef6
commit 6db870a372
13 changed files with 24 additions and 44 deletions

View File

@ -53,7 +53,7 @@ Button {
opacity: 0
Behavior on opacity {
NumberAnimation { duration: HStyle.animationDuration / 2 }
HNumberAnimation { duration: HStyle.animationDuration / 2 }
}
}
}

View File

@ -1,24 +1,22 @@
import QtQuick 2.7
ListView {
property int duration: HStyle.animationDuration
add: Transition {
NumberAnimation { properties: "x,y"; from: 100; duration: duration }
HNumberAnimation { properties: "x,y"; from: 100 }
}
move: Transition {
NumberAnimation { properties: "x,y"; duration: duration }
HNumberAnimation { properties: "x,y" }
}
displaced: Transition {
NumberAnimation { properties: "x,y"; duration: duration }
HNumberAnimation { properties: "x,y" }
}
remove: Transition {
ParallelAnimation {
NumberAnimation { property: "opacity"; to: 0; duration: duration }
NumberAnimation { properties: "x,y"; to: 100; duration: duration }
HNumberAnimation { property: "opacity"; to: 0 }
HNumberAnimation { properties: "x,y"; to: 100 }
}
}
}

View File

@ -0,0 +1,5 @@
import QtQuick 2.7
NumberAnimation {
duration: HStyle.animationDuration
}

View File

@ -88,11 +88,10 @@ HColumnLayout {
//onActiveViewChanged:
//activeView ? restoreAnimation.start() : hideAnimation.start()
//NumberAnimation {
//HNumberAnimation {
//id: hideAnimation
//target: roomSidePane
//properties: "width"
//duration: HStyle.animationDuration
//from: target.width
//to: 0
@ -102,11 +101,10 @@ HColumnLayout {
//}
//}
//NumberAnimation {
//HNumberAnimation {
//id: restoreAnimation
//target: roomSidePane
//properties: "width"
//duration: HStyle.animationDuration
//from: 0
//to: target.oldWidth

View File

@ -80,10 +80,7 @@ HRectangle {
}
Behavior on Layout.preferredWidth {
NumberAnimation {
id: buttonsAnimation
duration: HStyle.animationDuration
}
HNumberAnimation { id: buttonsAnimation }
}
}
}
@ -97,7 +94,7 @@ HRectangle {
iconName: "reduced_room_buttons"
Behavior on opacity {
NumberAnimation { duration: buttonsAnimation.duration * 2 }
HNumberAnimation { duration: buttonsAnimation.duration * 2 }
}
}
}

View File

@ -6,9 +6,7 @@ HColumnLayout {
property bool collapsed: false
property int normalSpacing: collapsed ? 0 : 8
Behavior on normalSpacing {
NumberAnimation { duration: HStyle.animationDuration }
}
Behavior on normalSpacing { HNumberAnimation {} }
HListView {
id: memberList

View File

@ -9,9 +9,7 @@ HRectangle {
implicitWidth: childrenRect.width
implicitHeight: typingLabel.text ? childrenRect.height : 0
Behavior on implicitHeight {
NumberAnimation { duration: HStyle.animationDuration }
}
Behavior on implicitHeight { HNumberAnimation {} }
Row {
spacing: 8

View File

@ -74,10 +74,7 @@ Column {
userId: roomCategoriesListUserId
Behavior on height {
NumberAnimation {
id: heightAnimation;
duration: HStyle.animationDuration
}
HNumberAnimation { id: heightAnimation }
}
}
}

View File

@ -15,8 +15,6 @@ HButton {
origin.x: expandButton.iconDimension / 2
origin.y: expandButton.iconDimension / 2
angle: expandableItem.expanded ? 90 : 180
Behavior on angle {
NumberAnimation { duration: HStyle.animationDuration }
}
Behavior on angle { HNumberAnimation {} }
}
}

View File

@ -12,9 +12,7 @@ Column {
height: normalHeight * opacity
visible: opacity > 0
Behavior on opacity {
NumberAnimation { duration: HStyle.animationDuration }
}
Behavior on opacity { HNumberAnimation {} }
property string roomListUserId: userId
property bool expanded: true
@ -51,10 +49,7 @@ Column {
category: name
Behavior on opacity {
NumberAnimation {
id: listHeightAnimation
duration: HStyle.animationDuration
}
HNumberAnimation { id: listHeightAnimation }
}
}
}

View File

@ -20,9 +20,7 @@ HRectangle {
bottomMargin: topMargin
Layout.leftMargin: topMargin
Behavior on spacing {
NumberAnimation { duration: HStyle.animationDuration }
}
Behavior on spacing { HNumberAnimation {} }
}
PaneToolBar {

View File

@ -52,7 +52,7 @@ Item {
Layout.maximumWidth: parent.width
Behavior on width {
NumberAnimation {
HNumberAnimation {
// Don't slow down the user manually resizing
duration:
(uiSplitView.canAutoSize &&

View File

@ -44,8 +44,6 @@ ApplicationWindow {
scale: uiLoader.ready ? 1 : 0.5
source: uiLoader.ready ? "UI.qml" : ""
Behavior on scale {
NumberAnimation { duration: HStyle.animationDuration }
}
Behavior on scale { HNumberAnimation {} }
}
}