Debian Codegraph @

src/GUI/qml/AircraftRating.qml

raw
1 import QtQuick 2.4
2 import FlightGear 1.0
3
4 Item {
5 id: root
6
7 property string title: ""
8 property int value: 3
9
10 implicitWidth: label.implicitWidth + ratingRow.implicitWidth + Style.margin
11 implicitHeight: label.height
12
13 StyledText {
14 id: label
15 anchors.right: ratingRow.left
16 anchors.rightMargin: Style.margin
17 anchors.left: parent.left
18
19 horizontalAlignment: Text.AlignRight
20 text: root.title + ":"
21 }
22
23 Row {
24 id: ratingRow
25
26 spacing: 2
27 anchors.right: parent.right
28 anchors.verticalCenter: parent.verticalCenter
29
30 Repeater {
31 model: 5
32
33 delegate: Rectangle {
34 color: ((model.index + 1) <= root.value) ? Style.themeColor : Style.disabledTextColor
35 width: radius * 2
36 height: radius * 2
37 radius: Style.roundRadius
38 }
39 }
40 }
41
42 }