HNumberAnimation component for standard duration
This commit is contained in:
parent
7b92264ef6
commit
6db870a372
|
@ -53,7 +53,7 @@ Button {
|
|||
opacity: 0
|
||||
|
||||
Behavior on opacity {
|
||||
NumberAnimation { duration: HStyle.animationDuration / 2 }
|
||||
HNumberAnimation { duration: HStyle.animationDuration / 2 }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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 }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
5
src/qml/Base/HNumberAnimation.qml
Normal file
5
src/qml/Base/HNumberAnimation.qml
Normal file
|
@ -0,0 +1,5 @@
|
|||
import QtQuick 2.7
|
||||
|
||||
NumberAnimation {
|
||||
duration: HStyle.animationDuration
|
||||
}
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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 }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -74,10 +74,7 @@ Column {
|
|||
userId: roomCategoriesListUserId
|
||||
|
||||
Behavior on height {
|
||||
NumberAnimation {
|
||||
id: heightAnimation;
|
||||
duration: HStyle.animationDuration
|
||||
}
|
||||
HNumberAnimation { id: heightAnimation }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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 {} }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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 }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,9 +20,7 @@ HRectangle {
|
|||
bottomMargin: topMargin
|
||||
Layout.leftMargin: topMargin
|
||||
|
||||
Behavior on spacing {
|
||||
NumberAnimation { duration: HStyle.animationDuration }
|
||||
}
|
||||
Behavior on spacing { HNumberAnimation {} }
|
||||
}
|
||||
|
||||
PaneToolBar {
|
||||
|
|
|
@ -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 &&
|
||||
|
|
|
@ -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 {} }
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user