Implement pulse animation option for ComboBox widget

You can now call pulse() on it and it'll pulse in the warning colour.

Contributes to issue CURA-8849.
This commit is contained in:
Ghostkeeper 2022-06-14 15:57:28 +02:00
parent bd131257fe
commit e095d41f0b
No known key found for this signature in database
GPG key ID: D2A8871EE34EC59A

View file

@ -54,7 +54,34 @@ ComboBox
}
]
background: UM.UnderlineBackground{}
background: UM.UnderlineBackground
{
//Rectangle for highlighting when this combobox needs to pulse.
Rectangle
{
anchors.fill: parent
opacity: 0
color: UM.Theme.getColor("warning")
SequentialAnimation on opacity
{
id: pulseAnimation
running: false
loops: 1
alwaysRunToEnd: true
PropertyAnimation
{
to: 1
duration: 300
}
PropertyAnimation
{
to: 0
duration : 2000
}
}
}
}
indicator: UM.ColorImage
{
@ -167,6 +194,6 @@ ComboBox
function pulse()
{
//TODO: Initiate a pulse of colour.
pulseAnimation.restart();
}
}