From feda206462824b52adad1fff83b04599c3076509 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Fri, 4 Dec 2026 11:32:58 +0100 Subject: feat(assistant): title bar with face, chat title, enlarge and close A row above the chat header: the assistant's face, the chat's title from the daemon ("Desktop Assistant" until it has one), and enlarge and close. Enlarged, the tall card fills the screen but a margin, for the session. Avatar moves out of Message.qml to be shared. Co-Authored-By: Claude Opus 5.5 --- desktop/assistant/Avatar.qml | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 desktop/assistant/Avatar.qml (limited to 'desktop/assistant/Avatar.qml') diff --git a/desktop/assistant/Avatar.qml b/desktop/assistant/Avatar.qml new file mode 100644 index 0000000..ae4bc7a --- /dev/null +++ b/desktop/assistant/Avatar.qml @@ -0,0 +1,39 @@ +// Copyright (C) 2026 Danilo M. +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License version 2 as +// published by the Free Software Foundation. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + + +import Quickshell.Widgets +import QtQuick +import ".." + +// A round avatar: a picture filling it, or with crop ([centre x, centre +// y, size] in the picture's pixels) that square of it. No picture: a plain +// circle. Message's turns and Card's title bar. +ClippingRectangle { + id: a + property string source: "" + property var crop: [] + width: 32 + height: width + radius: width / 2 + color: Theme.surfaceAlt + Image { + readonly property real k: a.crop.length ? a.width / a.crop[2] : 0 + source: a.source + visible: status === Image.Ready + mipmap: true + fillMode: a.crop.length ? Image.Stretch : Image.PreserveAspectCrop + width: a.crop.length ? implicitWidth * k : a.width + height: a.crop.length ? implicitHeight * k : a.height + x: a.crop.length ? -(a.crop[0] - a.crop[2] / 2) * k : 0 + y: a.crop.length ? -(a.crop[1] - a.crop[2] / 2) * k : 0 + } +} -- cgit v1.2.3