소스 검색

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

Denis V. Dedkov 7 년 전
부모
커밋
26399350c3
4개의 변경된 파일32개의 추가작업 그리고 1개의 파일을 삭제
  1. 30 1
      LightGroup.qml
  2. BIN
      Off.png
  3. BIN
      lamp.png
  4. 2 0
      qml.qrc

+ 30 - 1
LightGroup.qml

@@ -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


BIN
lamp.png


+ 2 - 0
qml.qrc

@@ -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>