id: dictListDelegate
Item {
width: rectangle1.width
- height: typeText.height
+ height: {
+ if (nameText.height + 10 > logo.height)
+ return nameText.height + 10;
+ else
+ return logo.height;
+ }
MouseArea{
anchors.fill: parent
onClicked: {
- dictTypeList.currentIndex = number
+ dictList.currentIndex = number
}
onDoubleClicked: {
selectedRow(number)
}
Row {
//image zaznacz/odznacz
- //image logo
+ anchors.fill: parent
+ Image {
+ id: checkbox
+// source: "qrc:/button/checkbox.png"
+ height: {
+ var aspectRatio = sourceSize.height / sourceSize.width
+ return logo.width * aspectRatio
+ }
+ anchors.verticalCenter: parent.verticalCenter
+ width: nameText.height + 10
+ states: [
+ State {
+ name: "checked";
+ when: (isSelected == true);
+
+ PropertyChanges { target: checkbox; source: "qrc:/button/checkboxChecked.png" }
+ },
+ State {
+ name: "unchecked";
+ when: (isSelected == false);
+
+ PropertyChanges { target: checkbox; source: "qrc:/button/checkbox.png" }
+ }
+ ]
+ }
+
Image {
id: logo
source: iconPath
+ height: {
+ var aspectRatio = sourceSize.height / sourceSize.width
+ return logo.width * aspectRatio
+ }
+ anchors.verticalCenter: parent.verticalCenter
+ width: nameText.height + 10
}
Text {
id: nameText
text: name
-// width: rectangle1.width
+ anchors.left: logo.right
+ anchors.leftMargin: 5
+ anchors.verticalCenter: parent.verticalCenter
}
}
}