2017-07-03 09:30:10 +02:00
|
|
|
import QtQuick 2.5
|
|
|
|
import QtQuick.Layouts 1.2
|
|
|
|
|
2017-12-20 14:54:05 +01:00
|
|
|
import Governikus.Global 1.0
|
2017-07-03 09:30:10 +02:00
|
|
|
|
|
|
|
Item {
|
|
|
|
id: baseItem
|
2017-07-03 09:33:28 +02:00
|
|
|
property alias contactModel: infoList.model
|
|
|
|
readonly property int contentHeight: infoList.contentHeight
|
2017-07-03 09:30:10 +02:00
|
|
|
|
|
|
|
|
|
|
|
ListView {
|
2017-07-03 09:33:28 +02:00
|
|
|
id: infoList
|
2017-07-03 09:30:10 +02:00
|
|
|
anchors.fill: parent
|
2017-07-03 09:33:28 +02:00
|
|
|
interactive: false
|
2017-07-03 09:30:10 +02:00
|
|
|
|
|
|
|
delegate: Item {
|
|
|
|
id: delegateItem
|
|
|
|
width: parent.width
|
|
|
|
height: Math.max(textItem.height, Utils.dp(50))
|
|
|
|
|
|
|
|
Image {
|
|
|
|
id: imageItem
|
|
|
|
fillMode: Image.PreserveAspectFit
|
|
|
|
height: Utils.dp(24)
|
|
|
|
width: Utils.dp(24)
|
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.leftMargin: Utils.dp(15)
|
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
2017-07-03 09:33:28 +02:00
|
|
|
source: Qt.resolvedUrl(model.iconSource)
|
2017-07-03 09:30:10 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
Text {
|
|
|
|
id: textItem
|
2018-03-28 15:10:51 +02:00
|
|
|
color: Constants.secondary_text
|
2017-12-20 14:54:05 +01:00
|
|
|
text: !!model.text ? model.text : qsTr("Unknown") + settingsModel.translationTrigger
|
2017-07-03 09:30:10 +02:00
|
|
|
verticalAlignment: Text.AlignVCenter
|
|
|
|
anchors.left: imageItem.right
|
|
|
|
anchors.leftMargin: Utils.dp(20)
|
|
|
|
anchors.right: parent.right
|
|
|
|
anchors.rightMargin: Utils.dp(10)
|
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
|
|
font.pixelSize: Utils.dp(16)
|
|
|
|
wrapMode: Text.WordWrap
|
|
|
|
textFormat: Text.RichText
|
|
|
|
}
|
|
|
|
|
|
|
|
MouseArea {
|
|
|
|
anchors.fill: delegateItem
|
2017-07-03 09:33:28 +02:00
|
|
|
enabled: !!model.link
|
|
|
|
onClicked: Qt.openUrlExternally(model.link)
|
2017-07-03 09:30:10 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
Rectangle {
|
|
|
|
anchors.bottom: parent.bottom
|
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.right: parent.right
|
|
|
|
height: 1
|
|
|
|
color: Constants.grey
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|