C++ / fmt (pull_request) Failing after 6s
C++ / build (pull_request) Failing after 10s
C++ / clang-tidy (pull_request) Failing after 9s
JS/TS / fmt (pull_request) Successful in 10s
JS/TS / lint (pull_request) Successful in 8s
Python / static (pull_request) Successful in 30s
Rust / build (pull_request) Successful in 49s
Python / verify (pull_request) Successful in 1m35s
Rust / fmt (pull_request) Successful in 36s
Rust / clippy (pull_request) Successful in 54s
129 lines
2.0 KiB
QML
129 lines
2.0 KiB
QML
import QtQuick
|
|
import QtQuick.Layouts
|
|
import ZShell.Llm
|
|
import ZShell.Config
|
|
import qs.Components
|
|
import qs.Services
|
|
|
|
Item {
|
|
id: root
|
|
|
|
required property ChatGeneration current
|
|
|
|
signal dismiss
|
|
|
|
implicitHeight: 0
|
|
|
|
Component.onCompleted: {
|
|
root.implicitHeight = Qt.binding(() => errorInner.implicitHeight + errorInner.anchors.margins * 2);
|
|
enterAnim.start();
|
|
}
|
|
|
|
Behavior on implicitHeight {
|
|
Anim {}
|
|
}
|
|
|
|
ParallelAnimation {
|
|
id: enterAnim
|
|
|
|
Anim {
|
|
target: container
|
|
property: "y"
|
|
from: container.implicitHeight
|
|
to: 0
|
|
}
|
|
|
|
Anim {
|
|
target: container
|
|
property: "opacity"
|
|
from: 0
|
|
to: 1
|
|
}
|
|
}
|
|
|
|
ParallelAnimation {
|
|
id: exitAnim
|
|
|
|
Anim {
|
|
target: root
|
|
property: "implicitHeight"
|
|
from: root.implicitHeight
|
|
to: 0
|
|
}
|
|
|
|
Anim {
|
|
target: container
|
|
property: "y"
|
|
to: container.implicitHeight
|
|
from: 0
|
|
}
|
|
|
|
Anim {
|
|
target: container
|
|
property: "opacity"
|
|
to: 0
|
|
from: 1
|
|
}
|
|
|
|
onFinished: root.dismiss()
|
|
}
|
|
|
|
CustomRect {
|
|
id: container
|
|
|
|
anchors.left: parent.left
|
|
anchors.right: parent.right
|
|
|
|
radius: Tokens.rounding.medium
|
|
color: Colors.palette.m3errorContainer
|
|
implicitHeight: errorInner.implicitHeight + errorInner.anchors.margins * 2
|
|
|
|
ColumnLayout {
|
|
id: errorInner
|
|
|
|
anchors.top: parent.top
|
|
anchors.left: parent.left
|
|
anchors.right: parent.right
|
|
anchors.margins: Tokens.padding.medium
|
|
|
|
spacing: Tokens.spacing.small
|
|
|
|
CustomText {
|
|
id: header
|
|
|
|
Layout.fillWidth: true
|
|
|
|
font: Tokens.font.headline.small
|
|
elide: CustomText.ElideRight
|
|
color: Colors.palette.m3onErrorContainer
|
|
|
|
text: qsTr("An error occured")
|
|
}
|
|
|
|
CustomText {
|
|
id: body
|
|
|
|
Layout.fillWidth: true
|
|
|
|
wrapMode: CustomText.WordWrap
|
|
color: Colors.palette.m3onErrorContainer
|
|
|
|
text: root.current.errorMessage || LlmClient.serverError
|
|
}
|
|
}
|
|
|
|
IconButton {
|
|
anchors.top: parent.top
|
|
anchors.right: parent.right
|
|
anchors.margins: Tokens.padding.medium
|
|
|
|
isRound: true
|
|
icon: "close"
|
|
type: IconButton.Text
|
|
font: Tokens.font.icon.medium
|
|
|
|
onClicked: exitAnim.start()
|
|
}
|
|
}
|
|
}
|