Ensure opacity/rotation of button icon is reset
After loading finished
This commit is contained in:
parent
560981a97e
commit
97b1608bcb
|
@ -20,18 +20,28 @@ HRowLayout {
|
||||||
|
|
||||||
|
|
||||||
HIcon {
|
HIcon {
|
||||||
|
property bool loading: button.loading || false
|
||||||
|
|
||||||
id: icon
|
id: icon
|
||||||
svgName: button.icon.name
|
svgName: button.icon.name
|
||||||
colorize: button.icon.color
|
colorize: button.icon.color
|
||||||
cache: button.icon.cache
|
cache: button.icon.cache
|
||||||
|
|
||||||
|
onLoadingChanged: if (! loading) resetAnimations.start()
|
||||||
|
|
||||||
Layout.fillHeight: true
|
Layout.fillHeight: true
|
||||||
Layout.alignment: Qt.AlignCenter
|
Layout.alignment: Qt.AlignCenter
|
||||||
|
|
||||||
HNumberAnimation {
|
|
||||||
|
ParallelAnimation {
|
||||||
|
id: resetAnimations
|
||||||
|
HNumberAnimation { target: icon; property: "opacity"; to: 1 }
|
||||||
|
HNumberAnimation { target: icon; property: "rotation"; to: 0 }
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
HNumberAnimation on opacity {
|
||||||
id: blink
|
id: blink
|
||||||
target: icon
|
|
||||||
property: "opacity"
|
|
||||||
from: 1
|
from: 1
|
||||||
to: 0.5
|
to: 0.5
|
||||||
factor: 2
|
factor: 2
|
||||||
|
|
Loading…
Reference in New Issue
Block a user