2022-03-09 13:36:34 +01:00
|
|
|
import QtQuick 2.6
|
|
|
|
|
import QtQuick.Layouts 1.0
|
|
|
|
|
import QtQuick.Controls 2.1
|
|
|
|
|
import QtQuick.Controls.Material 2.0
|
|
|
|
|
|
2023-02-10 14:11:31 +01:00
|
|
|
TextHighlightPane {
|
2022-03-09 13:36:34 +01:00
|
|
|
enum IconStyle {
|
|
|
|
|
None,
|
|
|
|
|
Info,
|
|
|
|
|
Warn,
|
|
|
|
|
Error
|
|
|
|
|
}
|
|
|
|
|
|
2022-10-19 14:15:24 +02:00
|
|
|
property alias text: infotext.text
|
2022-03-09 13:36:34 +01:00
|
|
|
property int iconStyle: InfoTextArea.IconStyle.Info
|
2022-08-26 13:21:49 +02:00
|
|
|
property alias textFormat: infotext.textFormat
|
2022-03-09 13:36:34 +01:00
|
|
|
|
2023-02-10 14:11:31 +01:00
|
|
|
borderColor: iconStyle == InfoTextArea.IconStyle.Info
|
|
|
|
|
? constants.colorInfo
|
|
|
|
|
: iconStyle == InfoTextArea.IconStyle.Warn
|
|
|
|
|
? constants.colorWarning
|
|
|
|
|
: iconStyle == InfoTextArea.IconStyle.Error
|
|
|
|
|
? constants.colorError
|
|
|
|
|
: constants.colorInfo
|
|
|
|
|
padding: constants.paddingXLarge
|
|
|
|
|
|
|
|
|
|
RowLayout {
|
2022-10-19 14:15:24 +02:00
|
|
|
width: parent.width
|
2023-02-16 13:22:24 +01:00
|
|
|
spacing: constants.paddingLarge
|
|
|
|
|
|
2023-02-10 14:11:31 +01:00
|
|
|
Image {
|
|
|
|
|
source: iconStyle == InfoTextArea.IconStyle.Info
|
|
|
|
|
? "../../../icons/info.png"
|
|
|
|
|
: iconStyle == InfoTextArea.IconStyle.Warn
|
|
|
|
|
? "../../../icons/warning.png"
|
|
|
|
|
: iconStyle == InfoTextArea.IconStyle.Error
|
|
|
|
|
? "../../../icons/expired.png"
|
|
|
|
|
: ""
|
|
|
|
|
Layout.preferredWidth: constants.iconSizeMedium
|
|
|
|
|
Layout.preferredHeight: constants.iconSizeMedium
|
2022-03-09 13:36:34 +01:00
|
|
|
}
|
|
|
|
|
|
2023-02-14 15:37:17 +01:00
|
|
|
Label {
|
2022-10-19 14:15:24 +02:00
|
|
|
id: infotext
|
|
|
|
|
Layout.fillWidth: true
|
2023-02-10 14:11:31 +01:00
|
|
|
width: parent.width
|
|
|
|
|
wrapMode: Text.Wrap
|
2022-10-19 14:15:24 +02:00
|
|
|
}
|
2022-03-09 13:36:34 +01:00
|
|
|
}
|
|
|
|
|
}
|