mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-08-06 21:48:30 -04:00
qs: integrate with dank-qml-common
This commit is contained in:
@@ -1,72 +1,13 @@
|
||||
pragma Singleton
|
||||
pragma ComponentBehavior: Bound
|
||||
|
||||
import QtQuick
|
||||
import Quickshell
|
||||
import qs.Common
|
||||
import qs.DankCommon.Common as DankCommon
|
||||
|
||||
// Reusable ListView/GridView transitions
|
||||
Singleton {
|
||||
id: root
|
||||
|
||||
// 0ms ViewTransitions break ListView delegate cleanup, so null the set when the shortest
|
||||
// duration truncates to 0. Keep this gate - don't inline these back into add/remove/etc.
|
||||
readonly property bool enabled: Math.floor(Theme.currentAnimationBaseDuration * 0.4) >= 1
|
||||
|
||||
readonly property Transition add: enabled ? _add : null
|
||||
readonly property Transition remove: null
|
||||
readonly property Transition displaced: enabled ? _displaced : null
|
||||
readonly property Transition move: enabled ? _move : null
|
||||
|
||||
readonly property int _staggerMs: Math.round(Theme.currentAnimationBaseDuration * 0.03)
|
||||
readonly property int _staggerCap: 8
|
||||
|
||||
readonly property Transition _add: Transition {
|
||||
id: addTransition
|
||||
|
||||
SequentialAnimation {
|
||||
PropertyAction {
|
||||
property: "opacity"
|
||||
value: 0
|
||||
}
|
||||
PauseAnimation {
|
||||
duration: Math.max(0, Math.min(addTransition.ViewTransition.index - (addTransition.ViewTransition.targetIndexes[0] ?? 0), root._staggerCap)) * root._staggerMs
|
||||
}
|
||||
DankAnim {
|
||||
property: "opacity"
|
||||
from: 0
|
||||
to: 1
|
||||
duration: Theme.expressiveDurations.fast
|
||||
easing.bezierCurve: Theme.expressiveCurves.emphasizedDecel
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
readonly property Transition _displaced: Transition {
|
||||
DankAnim {
|
||||
property: "y"
|
||||
duration: Theme.expressiveDurations.fast
|
||||
easing.bezierCurve: Theme.expressiveCurves.standard
|
||||
}
|
||||
DankAnim {
|
||||
property: "opacity"
|
||||
to: 1
|
||||
duration: Theme.expressiveDurations.fast
|
||||
easing.bezierCurve: Theme.expressiveCurves.standard
|
||||
}
|
||||
}
|
||||
|
||||
readonly property Transition _move: Transition {
|
||||
DankAnim {
|
||||
property: "y"
|
||||
duration: Theme.expressiveDurations.fast
|
||||
easing.bezierCurve: Theme.expressiveCurves.standard
|
||||
}
|
||||
DankAnim {
|
||||
property: "opacity"
|
||||
to: 1
|
||||
duration: Theme.expressiveDurations.fast
|
||||
easing.bezierCurve: Theme.expressiveCurves.standard
|
||||
}
|
||||
}
|
||||
readonly property bool enabled: DankCommon.ListViewTransitions.enabled
|
||||
readonly property Transition add: DankCommon.ListViewTransitions.add
|
||||
readonly property Transition remove: DankCommon.ListViewTransitions.remove
|
||||
readonly property Transition displaced: DankCommon.ListViewTransitions.displaced
|
||||
readonly property Transition move: DankCommon.ListViewTransitions.move
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user