2018-03-19 08:22:11 +00:00
|
|
|
import QtQuick 2.4
|
2017-12-05 20:53:47 +00:00
|
|
|
import "."
|
2017-06-22 09:45:47 +00:00
|
|
|
|
|
|
|
Item {
|
|
|
|
id: root
|
|
|
|
|
|
|
|
property string title: ""
|
|
|
|
property int value: 3
|
|
|
|
|
2017-12-05 20:53:47 +00:00
|
|
|
implicitWidth: Style.strutSize * 3
|
2017-06-22 09:45:47 +00:00
|
|
|
implicitHeight: label.height
|
|
|
|
|
2018-06-21 21:54:21 +00:00
|
|
|
StyledText {
|
2017-06-22 09:45:47 +00:00
|
|
|
id: label
|
|
|
|
anchors.right: ratingRow.left
|
2017-12-05 20:53:47 +00:00
|
|
|
anchors.rightMargin: Style.margin
|
2017-06-22 09:45:47 +00:00
|
|
|
anchors.left: parent.left
|
|
|
|
|
|
|
|
horizontalAlignment: Text.AlignRight
|
|
|
|
text: root.title + ":"
|
|
|
|
}
|
|
|
|
|
|
|
|
Row {
|
|
|
|
id: ratingRow
|
|
|
|
|
|
|
|
spacing: 2
|
|
|
|
anchors.right: parent.right
|
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
|
|
|
|
|
|
Repeater {
|
|
|
|
model: 5
|
|
|
|
|
|
|
|
delegate: Rectangle {
|
2017-11-22 15:35:21 +00:00
|
|
|
color: ((model.index + 1) <= root.value) ? "#3f3f3f" : "#cfcfcf"
|
2017-12-05 20:53:47 +00:00
|
|
|
width: radius * 2
|
|
|
|
height: radius * 2
|
|
|
|
radius: Style.roundRadius
|
2017-06-22 09:45:47 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|