on xenial help sign in
Cosmetics
d8415d2Andrea Cimitan
qml/Components/RatingStyle.qml+3
@@ -36,6 +36,9 @@ Row {
36 property url urlIconHalf: styledItem.urlIconHalf || "graphics/icon_star_half.png"
36 property url urlIconHalf: styledItem.urlIconHalf || "graphics/icon_star_half.png"
37
37
38 Image {
38 Image {
39+ height: parent.height
40+ fillMode: Image.PreserveAspectFit
41+ sourceSize.height: height
39 opacity: styledItem.value < 0 ? 0.4 : 1 // Let's make the stars look inactive for a not-set value
42 opacity: styledItem.value < 0 ? 0.4 : 1 // Let's make the stars look inactive for a not-set value
40 source: {
43 source: {
41 if (index === repeater.indexHalfValue) return repeater.urlIconHalf;
44 if (index === repeater.indexHalfValue) return repeater.urlIconHalf;
qml/Dash/Previews/PreviewRatingInput.qml+9−20
@@ -64,22 +64,16 @@ PreviewWidget {
64 triggered(root.widgetId, "rated", data);
64 triggered(root.widgetId, "rated", data);
65 }
65 }
66
66
67− Item {
67+ Column {
68 id: ratingLabelAndWidgetContainer
68 id: ratingLabelAndWidgetContainer
69− anchors {
70− left: parent.left
71− right: parent.right
69+ anchors { left: parent.left; right: parent.right; }
72− }
70+ spacing: units.gu(0.5)
73− implicitHeight: ratingLabel.height + rating.height
74 visible: widgetData["visible"] !== "review"
71 visible: widgetData["visible"] !== "review"
75
72
76 Label {
73 Label {
77 id: ratingLabel
74 id: ratingLabel
78 objectName: "ratingLabel"
75 objectName: "ratingLabel"
79− anchors {
80− left: parent.left
81− right: parent.right
76+ anchors { left: parent.left; right: parent.right; }
82− }
83 fontSize: "large"
77 fontSize: "large"
84 color: root.scopeStyle ? root.scopeStyle.foreground : theme.palette.normal.baseText
78 color: root.scopeStyle ? root.scopeStyle.foreground : theme.palette.normal.baseText
85 opacity: .8
79 opacity: .8
@@ -89,17 +83,15 @@ PreviewWidget {
89 Rating {
83 Rating {
90 id: rating
84 id: rating
91 objectName: "rating"
85 objectName: "rating"
92− anchors {
93− top: ratingLabel.bottom
94− left: parent.left
86+ anchors.left: parent.left
95− }
96 size: 5
87 size: 5
88+ height: units.gu(4)
97 onValueChanged: {
89 onValueChanged: {
98 if (widgetData["visible"] === "rating") root.submit();
90 if (widgetData["visible"] === "rating") root.submit();
99 }
91 }
100
92
101− property var urlIconEmpty: widgetData["rating-icon-empty"]
93+ property var urlIconEmpty: widgetData["rating-icon-empty"] || "image://theme/non-starred"
102− property var urlIconFull: widgetData["rating-icon-full"]
94+ property var urlIconFull: widgetData["rating-icon-full"] || "image://theme/starred"
103 }
95 }
104 }
96 }
105
97
@@ -131,10 +123,7 @@ PreviewWidget {
131 Item {
123 Item {
132 id: reviewSubmitContainer
124 id: reviewSubmitContainer
133 anchors {
125 anchors {
134− top: reviewLabel.bottom
135− left: parent.left
136− right: parent.right
137− bottom: parent.bottom
126+ fill: parent
138 topMargin: reviewContainer.innerMargin
127 topMargin: reviewContainer.innerMargin
139 }
128 }
140 implicitHeight: reviewTextArea.implicitHeight + anchors.topMargin
129 implicitHeight: reviewTextArea.implicitHeight + anchors.topMargin
tests/qmltests/Dash/Previews/tst_PreviewRatingInput.qml+1−2
@@ -73,11 +73,10 @@ Rectangle {
73
73
74 function test_labels() {
74 function test_labels() {
75 var ratingLabel = findChild(previewRatingInput, "ratingLabel");
75 var ratingLabel = findChild(previewRatingInput, "ratingLabel");
76− var reviewLabel = findChild(previewRatingInput, "reviewLabel");
77
76
78 previewRatingInput.widgetData = widgetDataNewLabels;
77 previewRatingInput.widgetData = widgetDataNewLabels;
79 compare(ratingLabel.text, widgetDataNewLabels["rating-label"]);
78 compare(ratingLabel.text, widgetDataNewLabels["rating-label"]);
80− compare(reviewLabel.text, widgetDataNewLabels["review-label"]);
79+ compare(reviewTextArea.placeholderText, widgetDataNewLabels["review-label"]);
81 compare(submitButton.text, widgetDataNewLabels["submit-label"]);
80 compare(submitButton.text, widgetDataNewLabels["submit-label"]);
82 }
81 }
83
82