1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-08-02 03:28:28 -04:00

lock: add blinking cursor for text input

fixes #2316
This commit is contained in:
bbedward
2026-07-02 15:20:11 -04:00
parent e423e17807
commit 2663bcd96c
3 changed files with 101 additions and 21 deletions
+31
View File
@@ -0,0 +1,31 @@
import QtQuick
import qs.Common
Rectangle {
id: root
property bool shown: true
property bool blinkOn: true
readonly property int flashTime: Qt.styleHints.cursorFlashTime
function resetBlink() {
blinkOn = true;
blinkTimer.restart();
}
width: 2
radius: 1
color: Theme.primary
visible: shown && blinkOn
onShownChanged: resetBlink()
Timer {
id: blinkTimer
running: root.shown && root.flashTime > 1
interval: root.flashTime / 2
repeat: true
onTriggered: root.blinkOn = !root.blinkOn
}
}