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 opacity: 0
Behavior on opacity { Behavior on opacity {
NumberAnimation { duration: HStyle.animationDuration / 2 } HNumberAnimation { duration: HStyle.animationDuration / 2 }
} }
} }
} }

View File

@ -1,24 +1,22 @@
import QtQuick 2.7 import QtQuick 2.7
ListView { ListView {
property int duration: HStyle.animationDuration
add: Transition { add: Transition {
NumberAnimation { properties: "x,y"; from: 100; duration: duration } HNumberAnimation { properties: "x,y"; from: 100 }
} }
move: Transition { move: Transition {
NumberAnimation { properties: "x,y"; duration: duration } HNumberAnimation { properties: "x,y" }
} }
displaced: Transition { displaced: Transition {
NumberAnimation { properties: "x,y"; duration: duration } HNumberAnimation { properties: "x,y" }
} }
remove: Transition { remove: Transition {
ParallelAnimation { ParallelAnimation {
NumberAnimation { property: "opacity"; to: 0; duration: duration } HNumberAnimation { property: "opacity"; to: 0 }
NumberAnimation { properties: "x,y"; to: 100; duration: duration } 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: //onActiveViewChanged:
//activeView ? restoreAnimation.start() : hideAnimation.start() //activeView ? restoreAnimation.start() : hideAnimation.start()
//NumberAnimation { //HNumberAnimation {
//id: hideAnimation //id: hideAnimation
//target: roomSidePane //target: roomSidePane
//properties: "width" //properties: "width"
//duration: HStyle.animationDuration
//from: target.width //from: target.width
//to: 0 //to: 0
@ -102,11 +101,10 @@ HColumnLayout {
//} //}
//} //}
//NumberAnimation { //HNumberAnimation {
//id: restoreAnimation //id: restoreAnimation
//target: roomSidePane //target: roomSidePane
//properties: "width" //properties: "width"
//duration: HStyle.animationDuration
//from: 0 //from: 0
//to: target.oldWidth //to: target.oldWidth

View File

@ -80,10 +80,7 @@ HRectangle {
} }
Behavior on Layout.preferredWidth { Behavior on Layout.preferredWidth {
NumberAnimation { HNumberAnimation { id: buttonsAnimation }
id: buttonsAnimation
duration: HStyle.animationDuration
}
} }
} }
} }
@ -97,7 +94,7 @@ HRectangle {
iconName: "reduced_room_buttons" iconName: "reduced_room_buttons"
Behavior on opacity { 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 bool collapsed: false
property int normalSpacing: collapsed ? 0 : 8 property int normalSpacing: collapsed ? 0 : 8
Behavior on normalSpacing { Behavior on normalSpacing { HNumberAnimation {} }
NumberAnimation { duration: HStyle.animationDuration }
}
HListView { HListView {
id: memberList id: memberList

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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