Refactor to use custom buttons

This commit is contained in:
Angela Mazzurco 2017-07-22 19:51:32 +02:00
parent 2ef2342363
commit ab46c8d457

View File

@ -66,37 +66,29 @@ Item
anchors.top: parent.top anchors.top: parent.top
anchors.bottom: bottomButton.top anchors.bottom: bottomButton.top
model: jsonModel.model model: jsonModel.model
anchors.horizontalCenter: parent.horizontalCenter
spacing: 3
delegate: Item delegate: Item
{ {
property bool isOnline: jsonModel.isOnline(model.pgp_id) property bool isOnline: jsonModel.isOnline(model.pgp_id)
height: 54 height: 54
width: parent.width width: parent.width
anchors.horizontalCenter: parent.horizontalCenter
Image ButtonText
{
id: statusImage
source: isOnline?
"icons/state-ok.svg" :
"icons/state-offline.svg"
height: parent.height - 4
sourceSize.height: height
fillMode: Image.PreserveAspectFit
anchors.left: parent.left
anchors.leftMargin: 3
anchors.verticalCenter: parent.verticalCenter
}
Text
{ {
id: locationButton
// anchors.horizontalCenter: parent.horizontalCenter
text: model.name text: model.name
anchors.verticalCenter: parent.verticalCenter borderRadius:0
anchors.left: statusImage.right iconUrl: isOnline?
anchors.leftMargin: 10 "/icons/state-ok.svg" :
font.pixelSize: 15 "/icons/state-offline.svg"
} color: "white"
MouseArea pressColor: "lightsteelblue"
{ buttonTextPixelSize: 18
anchors.fill: parent iconHeight:parent.height - 4
onClicked: onClicked:
{ {
stackView.push( stackView.push(