diff options
| author | Danilo M. <danix@danix.xyz> | 2026-10-19 20:42:15 +0200 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-10-19 20:42:15 +0200 |
| commit | 6b8aa1a47ce73101956c205314eb18dbeb9429a2 (patch) | |
| tree | 847fba1e23153ef8223ad2bbaf6a01f5c9e57945 /desktop/assistant | |
| parent | 2d51494f7aa574da3b054a8bbdcf2532ff32a71f (diff) | |
| download | quickshell-6b8aa1a47ce73101956c205314eb18dbeb9429a2.tar.gz quickshell-6b8aa1a47ce73101956c205314eb18dbeb9429a2.zip | |
assistant: count seconds on the running tool chip
A lit chip alone looks frozen on a clone that takes a minute; the running tool now shows the elapsed seconds and resets when it finishes.
Diffstat (limited to 'desktop/assistant')
| -rw-r--r-- | desktop/assistant/Message.qml | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/desktop/assistant/Message.qml b/desktop/assistant/Message.qml index fcf77ec..0aa686a 100644 --- a/desktop/assistant/Message.qml +++ b/desktop/assistant/Message.qml @@ -100,17 +100,27 @@ Column { model: msg.tools ? msg.tools.split(",") : [] Rectangle { required property string modelData - readonly property bool on: msg.live && msg.running === modelData + readonly property bool lit: msg.live && msg.running === modelData + property int elapsed: 0 width: chip.implicitWidth + 14 height: chip.implicitHeight + 6 radius: height / 2 color: Qt.alpha(Theme.surface, 0.9) - opacity: on ? 1 : 0.55 + opacity: lit ? 1 : 0.55 + // A lit chip alone looks frozen on a clone that takes a + // minute, so the running tool counts seconds. + onLitChanged: if (!lit) elapsed = 0 + Timer { + running: parent.lit + interval: 1000 + repeat: true + onTriggered: parent.elapsed++ + } Text { id: chip anchors.centerIn: parent - text: parent.modelData - color: parent.on ? Theme.text : Theme.subtext + text: parent.modelData + (parent.lit ? " · " + parent.elapsed + "s" : "") + color: parent.lit ? Theme.text : Theme.subtext font { family: Theme.fontFamily; pixelSize: Theme.fontSize - 5 } } } |
