Animate button loading
This commit is contained in:
parent
f5e52aed4e
commit
bf3847dd66
1
TODO.md
1
TODO.md
|
@ -34,6 +34,7 @@
|
|||
- Terrible performance using `QT_QPA_PLATFORM=wayland-egl`, must use `xcb`
|
||||
|
||||
- UI
|
||||
- Disable buttons when loading, disable edit profile when account loading
|
||||
- Make invite icon blink if there's no one but ourself in the room,
|
||||
but never do it again once the user hovered it long enough to show tooltip
|
||||
or clicked on it once
|
||||
|
|
|
@ -25,6 +25,54 @@ HRowLayout {
|
|||
|
||||
Layout.fillHeight: true
|
||||
Layout.alignment: Qt.AlignCenter
|
||||
|
||||
HNumberAnimation {
|
||||
id: blink
|
||||
target: icon
|
||||
property: "opacity"
|
||||
from: 1
|
||||
to: 0.3
|
||||
factor: 2
|
||||
running: button.loading || false
|
||||
onStopped: { [from, to] = [to, from]; start() }
|
||||
}
|
||||
|
||||
HNumberAnimation {
|
||||
target: icon
|
||||
property: "scale"
|
||||
from: 1
|
||||
to: 0.92
|
||||
factor: blink.factor
|
||||
running: blink.running
|
||||
onStopped: { [from, to] = [to, from]; start() }
|
||||
}
|
||||
|
||||
|
||||
SequentialAnimation {
|
||||
running: blink.running
|
||||
loops: Animation.Infinite
|
||||
|
||||
HPauseAnimation { factor: blink.factor * 8 }
|
||||
|
||||
HNumberAnimation {
|
||||
id: rotation1
|
||||
target: icon
|
||||
property: "rotation"
|
||||
from: 0
|
||||
to: 180
|
||||
factor: blink.factor
|
||||
}
|
||||
|
||||
HPauseAnimation { factor: blink.factor * 8 }
|
||||
|
||||
HNumberAnimation {
|
||||
target: rotation1.target
|
||||
property: rotation1.property
|
||||
from: rotation1.to
|
||||
to: 360
|
||||
factor: rotation1.factor
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
HLabel {
|
||||
|
|
7
src/qml/Base/HPauseAnimation.qml
Normal file
7
src/qml/Base/HPauseAnimation.qml
Normal file
|
@ -0,0 +1,7 @@
|
|||
import QtQuick 2.12
|
||||
|
||||
PauseAnimation {
|
||||
property real factor: 1.0
|
||||
|
||||
duration: theme.animationDuration * factor
|
||||
}
|
Loading…
Reference in New Issue
Block a user