mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-08-02 03:28:28 -04:00
animations: add DankColorAnimation helper to properly animate between
colors with different alpha values fixes #2720
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
pragma ComponentBehavior: Bound
|
||||
|
||||
import QtQuick
|
||||
import Quickshell
|
||||
import qs.Common
|
||||
import qs.Services
|
||||
import qs.Widgets
|
||||
@@ -319,13 +318,13 @@ FocusScope {
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
radius: height / 2
|
||||
color: categoryChip.isSelected ? Theme.primary : chipArea.containsMouse ? Theme.surfaceHover : Theme.surfaceVariantAlpha
|
||||
color: chipColor.value
|
||||
|
||||
Behavior on color {
|
||||
ColorAnimation {
|
||||
duration: root._fastDuration
|
||||
easing.type: Theme.standardEasing
|
||||
}
|
||||
DankColorAnimation {
|
||||
id: chipColor
|
||||
to: categoryChip.isSelected ? Theme.primary : chipArea.containsMouse ? Theme.surfaceHover : Theme.surfaceVariantAlpha
|
||||
duration: root._fastDuration
|
||||
easingType: Theme.standardEasing
|
||||
}
|
||||
|
||||
StyledText {
|
||||
|
||||
@@ -191,21 +191,21 @@ FloatingWindow {
|
||||
width: isActive ? dotSize * 3 : dotSize
|
||||
height: dotSize
|
||||
radius: dotSize / 2
|
||||
color: isActive ? Theme.primary : Theme.surfaceTextAlpha
|
||||
color: dotColor.value
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
|
||||
DankColorAnimation {
|
||||
id: dotColor
|
||||
to: isActive ? Theme.primary : Theme.surfaceTextAlpha
|
||||
duration: Theme.shortDuration
|
||||
}
|
||||
|
||||
Behavior on width {
|
||||
NumberAnimation {
|
||||
duration: Theme.shortDuration
|
||||
easing.type: Theme.emphasizedEasing
|
||||
}
|
||||
}
|
||||
|
||||
Behavior on color {
|
||||
ColorAnimation {
|
||||
duration: Theme.shortDuration
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user