mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-08-03 20:18:31 -04:00
animations: add DankColorAnimation helper to properly animate between
colors with different alpha values fixes #2720
This commit is contained in:
@@ -1283,10 +1283,15 @@ Item {
|
||||
|
||||
readonly property color requestedColor: isActive ? activeColor : isUrgent ? urgentColor : isPlaceholder ? Theme.surfaceTextLight : isHovered ? Theme.withAlpha(unfocusedColor, 0.7) : isOccupied ? occupiedColor : unfocusedColor
|
||||
|
||||
property color displayColor: requestedColor
|
||||
property bool colorAnimationReady: false
|
||||
|
||||
onRequestedColorChanged: Qt.callLater(() => delegateRoot.displayColor = delegateRoot.requestedColor)
|
||||
readonly property color displayColor: pillColor.value
|
||||
|
||||
DankColorAnimation {
|
||||
id: pillColor
|
||||
to: delegateRoot.requestedColor
|
||||
animated: delegateRoot.colorAnimationReady
|
||||
}
|
||||
|
||||
Item {
|
||||
id: dragHandler
|
||||
@@ -1560,14 +1565,6 @@ Item {
|
||||
}
|
||||
}
|
||||
|
||||
Behavior on color {
|
||||
enabled: delegateRoot.colorAnimationReady
|
||||
ColorAnimation {
|
||||
duration: Theme.mediumDuration
|
||||
easing.type: Theme.emphasizedEasing
|
||||
}
|
||||
}
|
||||
|
||||
Behavior on border.width {
|
||||
NumberAnimation {
|
||||
duration: Theme.mediumDuration
|
||||
|
||||
Reference in New Issue
Block a user