From 6b8aa1a47ce73101956c205314eb18dbeb9429a2 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Mon, 19 Oct 2026 20:42:15 +0200 Subject: 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. --- desktop/assistant/Message.qml | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'desktop/assistant/Message.qml') 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 } } } -- cgit v1.2.3