diff options
Diffstat (limited to 'desktop/assistant/Card.qml')
| -rw-r--r-- | desktop/assistant/Card.qml | 44 |
1 files changed, 43 insertions, 1 deletions
diff --git a/desktop/assistant/Card.qml b/desktop/assistant/Card.qml index f4e1af1..15819c6 100644 --- a/desktop/assistant/Card.qml +++ b/desktop/assistant/Card.qml @@ -40,6 +40,7 @@ Rectangle { + (status.visible ? status.height + 10 : 0) + (actions.visible ? actions.height + 10 : 0) Behavior on height { NumberAnimation { duration: 180; easing.type: Easing.OutCubic } } + Behavior on width { NumberAnimation { duration: 180; easing.type: Easing.OutCubic } } clip: true color: Qt.alpha(Theme.base, 0.82) @@ -161,12 +162,53 @@ Rectangle { function onChattingChanged() { input.forceActiveFocus(); } } + // --- title bar (chat): the face, the chat's title, enlarge and close --- + + Item { + id: titleBar + visible: card.mode === "chat" + anchors { top: parent.top; left: parent.left; right: parent.right; margins: 14 } + height: 28 + + Avatar { + anchors { left: parent.left; verticalCenter: parent.verticalCenter } + width: 28 + source: card.canvas.face.length ? card.canvas.fileUrl(card.canvas.backdrop) : "" + crop: card.canvas.face + } + Text { + anchors.centerIn: parent + width: Math.min(implicitWidth, parent.width - 2 * (winBtns.width + 12)) + elide: Text.ElideRight + text: card.canvas.title || "Desktop Assistant" + color: Theme.subtext + font { family: Theme.fontFamily; pixelSize: Theme.fontSize - 2; bold: true } + } + // nf-fa-compress / nf-fa-expand and nf-fa-xmark, as Keystone's + // titlebar. + Row { + id: winBtns + anchors { right: parent.right; verticalCenter: parent.verticalCenter } + spacing: 6 + WindowButton { + icon: card.canvas.big ? "\uf066" : "\uf065" + onClicked: card.canvas.big = !card.canvas.big + } + WindowButton { + icon: "\uf00d" + danger: true + onClicked: card.canvas.close() + } + } + } + // --- header (chat) --- Item { id: header visible: card.mode === "chat" - anchors { top: parent.top; left: parent.left; right: parent.right; margins: 14 } + anchors { top: titleBar.bottom; left: parent.left; right: parent.right + topMargin: 8; leftMargin: 14; rightMargin: 14 } height: 32 // The chat's model, a click opens the model panel. nf-fa-cloud for a |
