2024-10-15 19:26:12 +00:00
|
|
|
import QtQuick 2.15
|
|
|
|
import QtQuick.Controls 2.15
|
|
|
|
import QtQuick.Layouts 1.15
|
|
|
|
import QtGraphicalEffects 1.15
|
|
|
|
|
|
|
|
import StatusQ.Core.Theme 0.1
|
2021-09-28 15:04:06 +00:00
|
|
|
|
|
|
|
import utils 1.0
|
2021-03-10 04:59:01 +00:00
|
|
|
import ".."
|
2021-10-14 12:14:11 +00:00
|
|
|
import "../panels"
|
2021-03-10 04:59:01 +00:00
|
|
|
|
|
|
|
Item {
|
|
|
|
id: root
|
|
|
|
property bool isValid: true
|
|
|
|
property alias errorMessage: txtValidationError.text
|
|
|
|
property alias secondaryErrorMessage: txtValidationExtraInfo.text
|
|
|
|
property var images: []
|
|
|
|
property var validImages: []
|
|
|
|
|
|
|
|
visible: !isValid
|
|
|
|
width: imgExclamation.width + txtValidationError.width + txtValidationExtraInfo.width + 24
|
|
|
|
height: txtValidationError.height + 14
|
|
|
|
|
|
|
|
Rectangle {
|
|
|
|
anchors.fill: parent
|
2024-10-15 19:26:12 +00:00
|
|
|
color: Theme.palette.background
|
|
|
|
radius: Theme.halfPadding
|
2021-03-10 04:59:01 +00:00
|
|
|
layer.enabled: true
|
|
|
|
layer.effect: DropShadow {
|
|
|
|
verticalOffset: 3
|
|
|
|
radius: 8
|
|
|
|
samples: 15
|
|
|
|
fast: true
|
|
|
|
cached: true
|
|
|
|
color: "#22000000"
|
|
|
|
}
|
|
|
|
|
|
|
|
SVGImage {
|
|
|
|
id: imgExclamation
|
|
|
|
width: 20
|
|
|
|
height: 20
|
|
|
|
sourceSize.height: height * 2
|
|
|
|
sourceSize.width: width * 2
|
|
|
|
verticalAlignment: Image.AlignVCenter
|
|
|
|
anchors.top: parent.top
|
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.topMargin: 6
|
|
|
|
anchors.leftMargin: 6
|
|
|
|
fillMode: Image.PreserveAspectFit
|
2024-10-15 19:26:12 +00:00
|
|
|
source: Theme.svg("exclamation_outline")
|
2021-03-10 04:59:01 +00:00
|
|
|
}
|
|
|
|
StyledText {
|
|
|
|
id: txtValidationError
|
|
|
|
verticalAlignment: Text.AlignVCenter
|
|
|
|
anchors.top: parent.top
|
|
|
|
anchors.left: imgExclamation.right
|
|
|
|
anchors.topMargin: 7
|
|
|
|
anchors.leftMargin: 6
|
|
|
|
wrapMode: Text.WordWrap
|
|
|
|
font.pixelSize: 13
|
|
|
|
height: 18
|
2024-10-15 19:26:12 +00:00
|
|
|
color: Theme.palette.dangerColor1
|
2021-03-10 04:59:01 +00:00
|
|
|
}
|
|
|
|
StyledText {
|
|
|
|
id: txtValidationExtraInfo
|
|
|
|
verticalAlignment: Text.AlignVCenter
|
|
|
|
anchors.top: parent.top
|
|
|
|
anchors.left: txtValidationError.right
|
|
|
|
anchors.topMargin: 7
|
|
|
|
anchors.leftMargin: 6
|
|
|
|
wrapMode: Text.WordWrap
|
|
|
|
font.pixelSize: 13
|
|
|
|
height: 18
|
2024-10-15 19:26:12 +00:00
|
|
|
color: Theme.palette.textColor
|
2021-03-10 04:59:01 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|