1
0
This commit is contained in:
Sander van Grieken
2022-10-19 14:15:24 +02:00
parent 717b6dd5fb
commit c7cdd42665
7 changed files with 497 additions and 525 deletions

View File

@@ -3,9 +3,7 @@ import QtQuick.Layouts 1.0
import QtQuick.Controls 2.1
import QtQuick.Controls.Material 2.0
GridLayout {
property alias text: infotext.text
Item {
enum IconStyle {
None,
Info,
@@ -13,47 +11,54 @@ GridLayout {
Error
}
property alias text: infotext.text
property int iconStyle: InfoTextArea.IconStyle.Info
property alias textFormat: infotext.textFormat
columns: 1
rowSpacing: 0
implicitHeight: layout.height
Rectangle {
height: 2
Layout.fillWidth: true
color: Qt.rgba(1,1,1,0.25)
}
ColumnLayout {
id: layout
TextArea {
id: infotext
Layout.fillWidth: true
Layout.minimumHeight: constants.iconSizeLarge + 2*constants.paddingLarge
readOnly: true
rightPadding: constants.paddingLarge
leftPadding: 2*constants.iconSizeLarge
wrapMode: TextInput.Wrap
textFormat: TextEdit.RichText
background: Rectangle {
color: Qt.rgba(1,1,1,0.05) // whiten 5%
spacing: 0
width: parent.width
Rectangle {
height: 2
Layout.fillWidth: true
color: Qt.rgba(1,1,1,0.25)
}
Image {
source: iconStyle == InfoTextArea.IconStyle.Info ? "../../../icons/info.png" : iconStyle == InfoTextArea.IconStyle.Warn ? "../../../icons/warning.png" : iconStyle == InfoTextArea.IconStyle.Error ? "../../../icons/expired.png" : ""
anchors.left: parent.left
anchors.top: parent.top
anchors.leftMargin: constants.paddingLarge
anchors.topMargin: constants.paddingLarge
height: constants.iconSizeLarge
width: constants.iconSizeLarge
fillMode: Image.PreserveAspectCrop
TextArea {
id: infotext
Layout.fillWidth: true
Layout.minimumHeight: constants.iconSizeLarge + 2*constants.paddingLarge
readOnly: true
rightPadding: constants.paddingLarge
leftPadding: 2*constants.iconSizeLarge
wrapMode: TextInput.Wrap
textFormat: TextEdit.RichText
background: Rectangle {
color: Qt.rgba(1,1,1,0.05) // whiten 5%
}
Image {
source: iconStyle == InfoTextArea.IconStyle.Info ? "../../../icons/info.png" : iconStyle == InfoTextArea.IconStyle.Warn ? "../../../icons/warning.png" : iconStyle == InfoTextArea.IconStyle.Error ? "../../../icons/expired.png" : ""
anchors.left: parent.left
anchors.top: parent.top
anchors.leftMargin: constants.paddingLarge
anchors.topMargin: constants.paddingLarge
height: constants.iconSizeLarge
width: constants.iconSizeLarge
fillMode: Image.PreserveAspectCrop
}
}
}
Rectangle {
height: 2
Layout.fillWidth: true
color: Qt.rgba(0,0,0,0.25)
Rectangle {
height: 2
Layout.fillWidth: true
color: Qt.rgba(0,0,0,0.25)
}
}
}