Use OpacityAnimators instead of NumberAnimations

This commit is contained in:
miruka 2019-11-30 11:29:59 -04:00
parent d1e1ed07dd
commit 6a442da16f
12 changed files with 25 additions and 16 deletions

View File

@ -17,6 +17,8 @@
- Special treatment for matrix.to URLs?
- EventFile & Downloading (right click on media > save as...)
- Create room tabs brutal size transition
- Refactoring
- Room header elide detection
- Use HBox for Profile

View File

@ -11,7 +11,7 @@ Rectangle {
property QtObject buttonTheme
Behavior on opacity { HNumberAnimation {} }
Behavior on opacity { HOpacityAnimator {} }
Rectangle {

View File

@ -16,7 +16,7 @@ HRowLayout {
readonly property alias label: label
Behavior on opacity { HNumberAnimation {} }
Behavior on opacity { HOpacityAnimator {} }
HIcon {
@ -35,7 +35,7 @@ HRowLayout {
ParallelAnimation {
id: resetAnimations
HNumberAnimation { target: icon; property: "opacity"; to: 1 }
HOpacityAnimator { target: icon; to: 1 }
HNumberAnimation { target: icon; property: "rotation"; to: 0 }
}

View File

@ -17,7 +17,7 @@ CheckBox {
property alias subtitle: subtitleText
Behavior on opacity { HNumberAnimation { factor: 2 } }
Behavior on opacity { HOpacityAnimator { factor: 2 } }
indicator: Rectangle {

View File

@ -31,7 +31,7 @@ ListView {
add: Transition {
ParallelAnimation {
HNumberAnimation { property: "opacity"; from: 0; to: 1 }
HOpacityAnimator { from: 0; to: 1 }
HNumberAnimation { properties: "x,y"; from: 100 }
}
}
@ -39,14 +39,14 @@ ListView {
move: Transition {
ParallelAnimation {
// Ensure opacity goes to 1 if add/remove transition is interrupted
HNumberAnimation { property: "opacity"; to: 1 }
HOpacityAnimator { to: 1 }
HNumberAnimation { properties: "x,y" }
}
}
remove: Transition {
ParallelAnimation {
HNumberAnimation { property: "opacity"; to: 0 }
HOpacityAnimator { to: 0 }
HNumberAnimation { properties: "x,y"; to: 100 }
}
}

View File

@ -0,0 +1,7 @@
import QtQuick 2.12
OpacityAnimator {
duration: theme.animationDuration * factor
property real factor: 1.0
}

View File

@ -132,7 +132,7 @@ Rectangle {
icon.name: "reduced-room-buttons"
Behavior on opacity {
HNumberAnimation { duration: buttonsAnimation.duration * 2 }
HOpacityAnimator { duration: buttonsAnimation.duration * 2 }
}
}
}

View File

@ -88,7 +88,7 @@ HMxcImage {
opacity: hover.hovered ? 0 : 1
visible: opacity > 0
Behavior on opacity { HNumberAnimation {} }
Behavior on opacity { HOpacityAnimator {} }
}
EventImageTextBubble {
@ -99,6 +99,6 @@ HMxcImage {
opacity: hover.hovered ? 0 : 1
visible: opacity > 0
Behavior on opacity { HNumberAnimation {} }
Behavior on opacity { HOpacityAnimator {} }
}
}

View File

@ -81,7 +81,7 @@ HGridLayout {
(! avatar.mxc && overlayHover.hovered) ? 0.8 : 0.7
)
Behavior on opacity { HNumberAnimation {} }
Behavior on opacity { HOpacityAnimator {} }
Behavior on color { HColorAnimation {} }
HoverHandler { id: overlayHover }

View File

@ -67,7 +67,7 @@ HBox {
opacity: nameField.text ? 0 : 1
visible: opacity > 0
Behavior on opacity { HNumberAnimation {} }
Behavior on opacity { HOpacityAnimator {} }
}
}

View File

@ -20,7 +20,7 @@ HTileDelegate {
! sidePaneList.activateLimiter.running && ! sidePane.hasFocus
Behavior on opacity { HNumberAnimation {} }
Behavior on opacity { HOpacityAnimator {} }
property bool disconnecting: false
@ -74,7 +74,7 @@ HTileDelegate {
Layout.fillHeight: true
Behavior on opacity { HNumberAnimation {} }
Behavior on opacity { HOpacityAnimator {} }
}
HButton {
@ -102,7 +102,7 @@ HTileDelegate {
Behavior on angle { HNumberAnimation {} }
}
Behavior on opacity { HNumberAnimation {} }
Behavior on opacity { HOpacityAnimator {} }
}
contextMenu: HMenu {

View File

@ -18,7 +18,7 @@ HTileDelegate {
! sidePaneList.activateLimiter.running && ! sidePane.hasFocus
Behavior on opacity { HNumberAnimation {} }
Behavior on opacity { HOpacityAnimator {} }
readonly property bool invited: model.data.inviter_id && ! model.data.left