summaryrefslogtreecommitdiff
path: root/widgets/StyledTextField.qml
diff options
context:
space:
mode:
author2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-05-02 17:03:36 +1000
committer2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-05-02 17:03:36 +1000
commit7cbfce800a57091c20c7596f0875c8075166d110 (patch)
tree96d277f409c3ac2777af16d8eca6508f8c554a81 /widgets/StyledTextField.qml
parentlauncher: animate content (diff)
downloadcaelestia-shell-7cbfce800a57091c20c7596f0875c8075166d110.tar.gz
caelestia-shell-7cbfce800a57091c20c7596f0875c8075166d110.tar.bz2
caelestia-shell-7cbfce800a57091c20c7596f0875c8075166d110.zip
launcher: better app items
Also config max shown Custom cursor for styled text field
Diffstat (limited to 'widgets/StyledTextField.qml')
-rw-r--r--widgets/StyledTextField.qml38
1 files changed, 37 insertions, 1 deletions
diff --git a/widgets/StyledTextField.qml b/widgets/StyledTextField.qml
index f6232f2..cb1ce83 100644
--- a/widgets/StyledTextField.qml
+++ b/widgets/StyledTextField.qml
@@ -7,12 +7,48 @@ import QtQuick.Controls
TextField {
id: root
- renderType: TextField.NativeRendering
color: Appearance.colours.m3onSurface
placeholderTextColor: Appearance.colours.m3outline
font.family: Appearance.font.family.sans
font.pointSize: Appearance.font.size.smaller
+ cursorDelegate: StyledRect {
+ id: cursor
+
+ property bool disableBlink
+
+ implicitWidth: 2
+ color: Appearance.colours.m3primary
+ radius: Appearance.rounding.normal
+ onXChanged: {
+ opacity = 1;
+ disableBlink = true;
+ enableBlink.start();
+ }
+
+ Timer {
+ id: enableBlink
+
+ interval: 100
+ onTriggered: cursor.disableBlink = false
+ }
+
+ Timer {
+ running: root.cursorVisible && !cursor.disableBlink
+ repeat: true
+ interval: 500
+ onTriggered: parent.opacity = parent.opacity === 1 ? 0 : 1
+ }
+
+ Behavior on opacity {
+ NumberAnimation {
+ duration: Appearance.anim.durations.small
+ easing.type: Easing.BezierSpline
+ easing.bezierCurve: Appearance.anim.curves.standard
+ }
+ }
+ }
+
Behavior on color {
ColorAnimation {
duration: Appearance.anim.durations.normal