2023-03-14 02:52:16 +00:00
|
|
|
import QtQuick 2.15
|
|
|
|
import QtQuick.Layouts 1.15
|
|
|
|
|
|
|
|
import StatusQ.Core 0.1
|
|
|
|
import StatusQ.Core.Theme 0.1
|
|
|
|
|
|
|
|
Rectangle {
|
|
|
|
id: root
|
|
|
|
|
|
|
|
property string title
|
|
|
|
property string details
|
|
|
|
readonly property string detailsVisible: d.detailsVisible
|
|
|
|
|
2024-12-05 14:21:28 +00:00
|
|
|
implicitWidth: layout.implicitWidth
|
2023-03-14 02:52:16 +00:00
|
|
|
+ layout.anchors.leftMargin
|
|
|
|
+ layout.anchors.rigthMargin
|
|
|
|
|
|
|
|
implicitHeight: layout.implicitHeight
|
|
|
|
+ layout.anchors.topMargin
|
|
|
|
+ layout.anchors.bottomMargin
|
|
|
|
|
2024-12-05 14:21:28 +00:00
|
|
|
radius: Theme.radius
|
2023-03-14 02:52:16 +00:00
|
|
|
color: Theme.palette.baseColor4
|
|
|
|
|
|
|
|
QtObject {
|
|
|
|
id: d
|
|
|
|
property bool detailsVisible: false
|
|
|
|
}
|
|
|
|
|
2024-10-02 13:54:35 +00:00
|
|
|
CopyButton {
|
|
|
|
width: 20
|
|
|
|
height: 20
|
|
|
|
visible: d.detailsVisible
|
|
|
|
color: Theme.palette.baseColor1
|
|
|
|
anchors.top: parent.top
|
|
|
|
anchors.right: parent.right
|
2024-12-05 14:21:28 +00:00
|
|
|
anchors.topMargin: Theme.halfPadding
|
|
|
|
anchors.rightMargin: Theme.halfPadding
|
2024-10-02 13:54:35 +00:00
|
|
|
textToCopy: root.details
|
|
|
|
}
|
|
|
|
|
2023-03-14 02:52:16 +00:00
|
|
|
ColumnLayout {
|
|
|
|
id: layout
|
|
|
|
|
|
|
|
anchors.fill: parent
|
2024-12-05 14:21:28 +00:00
|
|
|
anchors.margins: Theme.smallPadding
|
2023-03-14 02:52:16 +00:00
|
|
|
spacing: 4
|
|
|
|
|
|
|
|
StatusBaseText {
|
|
|
|
Layout.fillWidth: true
|
|
|
|
horizontalAlignment: Qt.AlignHCenter
|
|
|
|
text: root.title
|
2024-12-05 14:21:28 +00:00
|
|
|
font.pixelSize: Theme.additionalTextSize
|
2023-03-14 02:52:16 +00:00
|
|
|
font.weight: Font.Medium
|
|
|
|
}
|
|
|
|
|
|
|
|
StatusBaseText {
|
|
|
|
Layout.fillWidth: true
|
|
|
|
horizontalAlignment: Qt.AlignHCenter
|
|
|
|
visible: !d.detailsVisible
|
|
|
|
text: qsTr("Show error details")
|
|
|
|
color: Theme.palette.primaryColor1
|
2024-12-05 14:21:28 +00:00
|
|
|
font.pixelSize: Theme.tertiaryTextFontSize
|
2023-03-14 02:52:16 +00:00
|
|
|
|
|
|
|
MouseArea {
|
|
|
|
anchors.fill: parent
|
|
|
|
onClicked: {
|
|
|
|
d.detailsVisible = true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
StatusBaseText {
|
|
|
|
Layout.fillWidth: true
|
|
|
|
horizontalAlignment: Qt.AlignHCenter
|
|
|
|
visible: d.detailsVisible
|
|
|
|
text: root.details
|
|
|
|
color: Theme.palette.baseColor1
|
2024-12-05 14:21:28 +00:00
|
|
|
font.pixelSize: Theme.tertiaryTextFontSize
|
2023-03-14 02:52:16 +00:00
|
|
|
wrapMode: Text.WordWrap
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|