Refactor to fill column with mouse area

This commit is contained in:
Angela Mazzurco 2017-07-24 17:31:21 +02:00
parent 9449e3b439
commit 12b642cc84

View File

@ -110,48 +110,63 @@ Item
} }
delegate: Column delegate:
MouseArea
{ {
height: 60
width: parent.width width: parent.width
leftPadding: 4 height: innerCol.height
spacing: 4
Row onClicked:
{ {
id: idRow console.log("triggerLocationConnectionAttempt()")
height: 30 }
Column
{
id: innerCol
height: 60
width: parent.width
leftPadding: 4
spacing: 4 spacing: 4
Image Row
{ {
id: statusImage id: idRow
source: model.is_online ? height: 30
"icons/network-connect.svg" : spacing: 4
"icons/network-disconnect.svg"
height: parent.height - 4 Image
sourceSize.height: height {
fillMode: Image.PreserveAspectFit id: statusImage
anchors.verticalCenter: parent.verticalCenter source: model.is_online ?
"icons/network-connect.svg" :
"icons/network-disconnect.svg"
height: parent.height - 4
sourceSize.height: height
fillMode: Image.PreserveAspectFit
anchors.verticalCenter: parent.verticalCenter
}
Text
{
id: locNameText
text: model.location
anchors.verticalCenter: parent.verticalCenter
}
} }
Text
TextAndIcon
{ {
id: locNameText width: parent.width
text: model.location innerText: model.peer_id
anchors.verticalCenter: parent.verticalCenter anchors.horizontalCenter: parent.horizontalCenter
iconUrl: "/icons/keyring.svg"
} }
} }
TextAndIcon
{
width: parent.width
innerText: model.peer_id
anchors.horizontalCenter: parent.horizontalCenter
iconUrl: "/icons/keyring.svg"
}
} }
} }
Row Row