mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-08-05 04:58:30 -04:00
animations: add DankColorAnimation helper to properly animate between
colors with different alpha values fixes #2720
This commit is contained in:
@@ -424,26 +424,22 @@ Item {
|
||||
id: surface
|
||||
anchors.fill: parent
|
||||
radius: rowItem.dragging ? Theme.cornerRadius + 6 : Theme.cornerRadius
|
||||
color: {
|
||||
if (rowItem.dragging)
|
||||
return Theme.secondaryContainer;
|
||||
const base = Theme.surfaceContainer;
|
||||
return Theme.withAlpha(base, rowItem.isEnabled ? 0.7 : 0.4);
|
||||
}
|
||||
color: surfaceColor.value
|
||||
border.width: rowItem.dragging ? 2 : 1
|
||||
border.color: rowItem.dragging ? Theme.primary : Theme.outlineHeavy
|
||||
|
||||
DankColorAnimation {
|
||||
id: surfaceColor
|
||||
to: rowItem.dragging ? Theme.secondaryContainer : Theme.withAlpha(Theme.surfaceContainer, rowItem.isEnabled ? 0.7 : 0.4)
|
||||
duration: Theme.shortDuration
|
||||
}
|
||||
|
||||
Behavior on radius {
|
||||
NumberAnimation {
|
||||
duration: Theme.shortDuration
|
||||
easing.type: Easing.OutCubic
|
||||
}
|
||||
}
|
||||
Behavior on color {
|
||||
ColorAnimation {
|
||||
duration: Theme.shortDuration
|
||||
}
|
||||
}
|
||||
Behavior on border.color {
|
||||
ColorAnimation {
|
||||
duration: Theme.shortDuration
|
||||
|
||||
Reference in New Issue
Block a user