mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-16 14:35:54 +08:00
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:
parent
bd131257fe
commit
e095d41f0b
@ -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();
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user