diff --git a/TODO.md b/TODO.md index 59ec7784..7461a543 100644 --- a/TODO.md +++ b/TODO.md @@ -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 diff --git a/src/qml/Base/HButtonBackground.qml b/src/qml/Base/HButtonBackground.qml index 52efb65b..b82902f7 100644 --- a/src/qml/Base/HButtonBackground.qml +++ b/src/qml/Base/HButtonBackground.qml @@ -11,7 +11,7 @@ Rectangle { property QtObject buttonTheme - Behavior on opacity { HNumberAnimation {} } + Behavior on opacity { HOpacityAnimator {} } Rectangle { diff --git a/src/qml/Base/HButtonContent.qml b/src/qml/Base/HButtonContent.qml index be91a266..eedbc1ea 100644 --- a/src/qml/Base/HButtonContent.qml +++ b/src/qml/Base/HButtonContent.qml @@ -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 } } diff --git a/src/qml/Base/HCheckBox.qml b/src/qml/Base/HCheckBox.qml index c8ba8f2e..e6fb3855 100644 --- a/src/qml/Base/HCheckBox.qml +++ b/src/qml/Base/HCheckBox.qml @@ -17,7 +17,7 @@ CheckBox { property alias subtitle: subtitleText - Behavior on opacity { HNumberAnimation { factor: 2 } } + Behavior on opacity { HOpacityAnimator { factor: 2 } } indicator: Rectangle { diff --git a/src/qml/Base/HListView.qml b/src/qml/Base/HListView.qml index 2c485438..610370cf 100644 --- a/src/qml/Base/HListView.qml +++ b/src/qml/Base/HListView.qml @@ -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 } } } diff --git a/src/qml/Base/HOpacityAnimator.qml b/src/qml/Base/HOpacityAnimator.qml new file mode 100644 index 00000000..7fab7366 --- /dev/null +++ b/src/qml/Base/HOpacityAnimator.qml @@ -0,0 +1,7 @@ +import QtQuick 2.12 + +OpacityAnimator { + duration: theme.animationDuration * factor + + property real factor: 1.0 +} diff --git a/src/qml/Chat/RoomHeader.qml b/src/qml/Chat/RoomHeader.qml index eb5818ab..5a662acd 100644 --- a/src/qml/Chat/RoomHeader.qml +++ b/src/qml/Chat/RoomHeader.qml @@ -132,7 +132,7 @@ Rectangle { icon.name: "reduced-room-buttons" Behavior on opacity { - HNumberAnimation { duration: buttonsAnimation.duration * 2 } + HOpacityAnimator { duration: buttonsAnimation.duration * 2 } } } } diff --git a/src/qml/Chat/Timeline/EventImage.qml b/src/qml/Chat/Timeline/EventImage.qml index 34d17498..632340df 100644 --- a/src/qml/Chat/Timeline/EventImage.qml +++ b/src/qml/Chat/Timeline/EventImage.qml @@ -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 {} } } } diff --git a/src/qml/Pages/AccountSettings/Profile.qml b/src/qml/Pages/AccountSettings/Profile.qml index 46335339..62c9556d 100644 --- a/src/qml/Pages/AccountSettings/Profile.qml +++ b/src/qml/Pages/AccountSettings/Profile.qml @@ -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 } diff --git a/src/qml/Pages/AddChat/CreateRoom.qml b/src/qml/Pages/AddChat/CreateRoom.qml index e375b576..e2141a6f 100644 --- a/src/qml/Pages/AddChat/CreateRoom.qml +++ b/src/qml/Pages/AddChat/CreateRoom.qml @@ -67,7 +67,7 @@ HBox { opacity: nameField.text ? 0 : 1 visible: opacity > 0 - Behavior on opacity { HNumberAnimation {} } + Behavior on opacity { HOpacityAnimator {} } } } diff --git a/src/qml/SidePane/AccountDelegate.qml b/src/qml/SidePane/AccountDelegate.qml index 92c94176..8c1e4e6b 100644 --- a/src/qml/SidePane/AccountDelegate.qml +++ b/src/qml/SidePane/AccountDelegate.qml @@ -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 { diff --git a/src/qml/SidePane/RoomDelegate.qml b/src/qml/SidePane/RoomDelegate.qml index 510ddd30..64545160 100644 --- a/src/qml/SidePane/RoomDelegate.qml +++ b/src/qml/SidePane/RoomDelegate.qml @@ -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