From 7cbfce800a57091c20c7596f0875c8075166d110 Mon Sep 17 00:00:00 2001 From: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> Date: Fri, 2 May 2025 17:03:36 +1000 Subject: launcher: better app items Also config max shown Custom cursor for styled text field --- widgets/StyledTextField.qml | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) (limited to 'widgets') 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 -- cgit v1.2.3-freya