init: working version
This commit is contained in:
commit
7d8d7dacae
109 changed files with 15066 additions and 0 deletions
46
custom/CustomText.qml
Normal file
46
custom/CustomText.qml
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
|
||||
import QtQuick
|
||||
import Quickshell
|
||||
import qs.config
|
||||
|
||||
Text {
|
||||
id: root
|
||||
|
||||
// Either boolean or function taking old and new text
|
||||
property var animate: false
|
||||
property string animateProp: "opacity"
|
||||
property real animateFrom: 0
|
||||
property real animateTo: 1
|
||||
property int animateDuration: Config.anim.durations.normal
|
||||
|
||||
renderType: Text.NativeRendering
|
||||
textFormat: Text.PlainText
|
||||
color: Config.colors.primary
|
||||
linkColor: Config.colors.highlight
|
||||
font.family: Config.font.family.sans
|
||||
font.pointSize: Config.font.size.smaller
|
||||
|
||||
Behavior on text {
|
||||
enabled: typeof root.animate === "boolean"
|
||||
? root.animate : root.animate(root.text, targetValue)
|
||||
|
||||
SequentialAnimation {
|
||||
Anim {
|
||||
to: root.animateFrom
|
||||
easing.bezierCurve: Config.anim.curves.standardAccel
|
||||
}
|
||||
PropertyAction {}
|
||||
Anim {
|
||||
to: root.animateTo
|
||||
easing.bezierCurve: Config.anim.curves.standardDecel
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
component Anim: NumberAnimation {
|
||||
target: root
|
||||
property: root.animateProp
|
||||
duration: root.animateDuration / 2
|
||||
easing.type: Easing.BezierSpline
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue