Доделал делегат

This commit is contained in:
2018-07-24 12:25:27 +02:00
parent f6a03e1565
commit 26399350c3
4 changed files with 32 additions and 1 deletions

View File

@@ -20,8 +20,18 @@ Item {
radius: 5
Label {
text: root.title
anchors.centerIn: parent
text: root.title
}
Image {
anchors.left: parent.left
anchors.top: parent.top
anchors.bottom: parent.bottom
anchors.margins: 5
width: height
source: "Off.png"
}
}
@@ -39,9 +49,28 @@ Item {
width: root.width
GradientButton {
id: button
width: (root.width - buttonsRow.spacing * (root.lights.count - 1)) / root.lights.count
height: width / 2
radius: 5
Column {
anchors.centerIn: parent
Image {
height: button.height * 0.5
width: height
anchors.horizontalCenter: parent.horizontalCenter
source: "lamp.png"
}
Label {
anchors.horizontalCenter: parent.horizontalCenter
horizontalAlignment: Text.horizontalCenter
text: name
}
}
}
}
}

BIN
Off.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

BIN
lamp.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

View File

@@ -9,5 +9,7 @@
<file>LightsModel.qml</file>
<file>LightGroup.qml</file>
<file>GradientButton.qml</file>
<file>lamp.png</file>
<file>Off.png</file>
</qresource>
</RCC>