Use OpacityAnimators instead of NumberAnimations
This commit is contained in:
		
							
								
								
									
										2
									
								
								TODO.md
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								TODO.md
									
									
									
									
									
								
							@@ -17,6 +17,8 @@
 | 
				
			|||||||
    - Special treatment for matrix.to URLs?
 | 
					    - Special treatment for matrix.to URLs?
 | 
				
			||||||
  - EventFile & Downloading (right click on media > save as...)
 | 
					  - EventFile & Downloading (right click on media > save as...)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  - Create room tabs brutal size transition
 | 
				
			||||||
 | 
					
 | 
				
			||||||
- Refactoring
 | 
					- Refactoring
 | 
				
			||||||
  - Room header elide detection
 | 
					  - Room header elide detection
 | 
				
			||||||
  - Use HBox for Profile
 | 
					  - Use HBox for Profile
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -11,7 +11,7 @@ Rectangle {
 | 
				
			|||||||
    property QtObject buttonTheme
 | 
					    property QtObject buttonTheme
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    Behavior on opacity { HNumberAnimation {} }
 | 
					    Behavior on opacity { HOpacityAnimator {} }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    Rectangle {
 | 
					    Rectangle {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -16,7 +16,7 @@ HRowLayout {
 | 
				
			|||||||
    readonly property alias label: label
 | 
					    readonly property alias label: label
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    Behavior on opacity { HNumberAnimation {} }
 | 
					    Behavior on opacity { HOpacityAnimator {} }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    HIcon {
 | 
					    HIcon {
 | 
				
			||||||
@@ -35,7 +35,7 @@ HRowLayout {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        ParallelAnimation {
 | 
					        ParallelAnimation {
 | 
				
			||||||
            id: resetAnimations
 | 
					            id: resetAnimations
 | 
				
			||||||
            HNumberAnimation { target: icon; property: "opacity"; to: 1 }
 | 
					            HOpacityAnimator { target: icon; to: 1 }
 | 
				
			||||||
            HNumberAnimation { target: icon; property: "rotation"; to: 0 }
 | 
					            HNumberAnimation { target: icon; property: "rotation"; to: 0 }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -17,7 +17,7 @@ CheckBox {
 | 
				
			|||||||
    property alias subtitle: subtitleText
 | 
					    property alias subtitle: subtitleText
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    Behavior on opacity { HNumberAnimation { factor: 2 } }
 | 
					    Behavior on opacity { HOpacityAnimator { factor: 2 } }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    indicator: Rectangle {
 | 
					    indicator: Rectangle {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -31,7 +31,7 @@ ListView {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    add: Transition {
 | 
					    add: Transition {
 | 
				
			||||||
        ParallelAnimation {
 | 
					        ParallelAnimation {
 | 
				
			||||||
            HNumberAnimation { property: "opacity"; from: 0; to: 1 }
 | 
					            HOpacityAnimator { from: 0; to: 1 }
 | 
				
			||||||
            HNumberAnimation { properties: "x,y"; from: 100 }
 | 
					            HNumberAnimation { properties: "x,y"; from: 100 }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
@@ -39,14 +39,14 @@ ListView {
 | 
				
			|||||||
    move: Transition {
 | 
					    move: Transition {
 | 
				
			||||||
        ParallelAnimation {
 | 
					        ParallelAnimation {
 | 
				
			||||||
            // Ensure opacity goes to 1 if add/remove transition is interrupted
 | 
					            // Ensure opacity goes to 1 if add/remove transition is interrupted
 | 
				
			||||||
            HNumberAnimation { property: "opacity"; to: 1 }
 | 
					            HOpacityAnimator { to: 1 }
 | 
				
			||||||
            HNumberAnimation { properties: "x,y" }
 | 
					            HNumberAnimation { properties: "x,y" }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    remove: Transition {
 | 
					    remove: Transition {
 | 
				
			||||||
        ParallelAnimation {
 | 
					        ParallelAnimation {
 | 
				
			||||||
            HNumberAnimation { property: "opacity"; to: 0 }
 | 
					            HOpacityAnimator { to: 0 }
 | 
				
			||||||
            HNumberAnimation { properties: "x,y"; to: 100 }
 | 
					            HNumberAnimation { properties: "x,y"; to: 100 }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										7
									
								
								src/qml/Base/HOpacityAnimator.qml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										7
									
								
								src/qml/Base/HOpacityAnimator.qml
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,7 @@
 | 
				
			|||||||
 | 
					import QtQuick 2.12
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					OpacityAnimator {
 | 
				
			||||||
 | 
					    duration: theme.animationDuration * factor
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    property real factor: 1.0
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@@ -132,7 +132,7 @@ Rectangle {
 | 
				
			|||||||
        icon.name: "reduced-room-buttons"
 | 
					        icon.name: "reduced-room-buttons"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        Behavior on opacity {
 | 
					        Behavior on opacity {
 | 
				
			||||||
            HNumberAnimation { duration: buttonsAnimation.duration * 2 }
 | 
					            HOpacityAnimator { duration: buttonsAnimation.duration * 2 }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -88,7 +88,7 @@ HMxcImage {
 | 
				
			|||||||
        opacity: hover.hovered ? 0 : 1
 | 
					        opacity: hover.hovered ? 0 : 1
 | 
				
			||||||
        visible: opacity > 0
 | 
					        visible: opacity > 0
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        Behavior on opacity { HNumberAnimation {} }
 | 
					        Behavior on opacity { HOpacityAnimator {} }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    EventImageTextBubble {
 | 
					    EventImageTextBubble {
 | 
				
			||||||
@@ -99,6 +99,6 @@ HMxcImage {
 | 
				
			|||||||
        opacity: hover.hovered ? 0 : 1
 | 
					        opacity: hover.hovered ? 0 : 1
 | 
				
			||||||
        visible: opacity > 0
 | 
					        visible: opacity > 0
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        Behavior on opacity { HNumberAnimation {} }
 | 
					        Behavior on opacity { HOpacityAnimator {} }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -81,7 +81,7 @@ HGridLayout {
 | 
				
			|||||||
                (! avatar.mxc && overlayHover.hovered) ? 0.8 : 0.7
 | 
					                (! avatar.mxc && overlayHover.hovered) ? 0.8 : 0.7
 | 
				
			||||||
            )
 | 
					            )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            Behavior on opacity { HNumberAnimation {} }
 | 
					            Behavior on opacity { HOpacityAnimator {} }
 | 
				
			||||||
            Behavior on color { HColorAnimation {} }
 | 
					            Behavior on color { HColorAnimation {} }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            HoverHandler { id: overlayHover }
 | 
					            HoverHandler { id: overlayHover }
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -67,7 +67,7 @@ HBox {
 | 
				
			|||||||
            opacity: nameField.text ? 0 : 1
 | 
					            opacity: nameField.text ? 0 : 1
 | 
				
			||||||
            visible: opacity > 0
 | 
					            visible: opacity > 0
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            Behavior on opacity { HNumberAnimation {} }
 | 
					            Behavior on opacity { HOpacityAnimator {} }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -20,7 +20,7 @@ HTileDelegate {
 | 
				
			|||||||
        ! sidePaneList.activateLimiter.running && ! sidePane.hasFocus
 | 
					        ! sidePaneList.activateLimiter.running && ! sidePane.hasFocus
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    Behavior on opacity { HNumberAnimation {} }
 | 
					    Behavior on opacity { HOpacityAnimator {} }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    property bool disconnecting: false
 | 
					    property bool disconnecting: false
 | 
				
			||||||
@@ -74,7 +74,7 @@ HTileDelegate {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        Layout.fillHeight: true
 | 
					        Layout.fillHeight: true
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        Behavior on opacity { HNumberAnimation {} }
 | 
					        Behavior on opacity { HOpacityAnimator {} }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    HButton {
 | 
					    HButton {
 | 
				
			||||||
@@ -102,7 +102,7 @@ HTileDelegate {
 | 
				
			|||||||
            Behavior on angle { HNumberAnimation {} }
 | 
					            Behavior on angle { HNumberAnimation {} }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        Behavior on opacity { HNumberAnimation {} }
 | 
					        Behavior on opacity { HOpacityAnimator {} }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    contextMenu: HMenu {
 | 
					    contextMenu: HMenu {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -18,7 +18,7 @@ HTileDelegate {
 | 
				
			|||||||
        ! sidePaneList.activateLimiter.running && ! sidePane.hasFocus
 | 
					        ! sidePaneList.activateLimiter.running && ! sidePane.hasFocus
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    Behavior on opacity { HNumberAnimation {} }
 | 
					    Behavior on opacity { HOpacityAnimator {} }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    readonly property bool invited: model.data.inviter_id && ! model.data.left
 | 
					    readonly property bool invited: model.data.inviter_id && ! model.data.left
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user