on xenial help sign in
Cosmetics
commitd8415d24f25883584cee5d8f8e5a8284c1c25c81 authorAndrea Cimitan <andrea.cimitan@gmail.com> dateThu 25 Feb 2016, 12:47 (11 years ago) parentefd5a5d
3 files changed+13−22
qml/Components/RatingStyle.qml+3 qml/Dash/Previews/PreviewRatingInput.qml+9−20 tests/qmltests/Dash/Previews/tst_PreviewRatingInput.qml+1−2
qml/Components/RatingStyle.qml+3
@@ -36,6 +36,9 @@ Row {
3636 property url urlIconHalf: styledItem.urlIconHalf || "graphics/icon_star_half.png"
3737
3838 Image {
39+ height: parent.height
40+ fillMode: Image.PreserveAspectFit
41+ sourceSize.height: height
3942 opacity: styledItem.value < 0 ? 0.4 : 1 // Let's make the stars look inactive for a not-set value
4043 source: {
4144 if (index === repeater.indexHalfValue) return repeater.urlIconHalf;
qml/Dash/Previews/PreviewRatingInput.qml+9−20
@@ -64,22 +64,16 @@ PreviewWidget {
6464 triggered(root.widgetId, "rated", data);
6565 }
6666
67− Item {
67+ Column {
6868 id: ratingLabelAndWidgetContainer
69− anchors {
70− left: parent.left
71− right: parent.right
72− }
73− implicitHeight: ratingLabel.height + rating.height
69+ anchors { left: parent.left; right: parent.right; }
70+ spacing: units.gu(0.5)
7471 visible: widgetData["visible"] !== "review"
7572
7673 Label {
7774 id: ratingLabel
7875 objectName: "ratingLabel"
79− anchors {
80− left: parent.left
81− right: parent.right
82− }
76+ anchors { left: parent.left; right: parent.right; }
8377 fontSize: "large"
8478 color: root.scopeStyle ? root.scopeStyle.foreground : theme.palette.normal.baseText
8579 opacity: .8
@@ -89,17 +83,15 @@ PreviewWidget {
8983 Rating {
9084 id: rating
9185 objectName: "rating"
92− anchors {
93− top: ratingLabel.bottom
94− left: parent.left
95− }
86+ anchors.left: parent.left
9687 size: 5
88+ height: units.gu(4)
9789 onValueChanged: {
9890 if (widgetData["visible"] === "rating") root.submit();
9991 }
10092
101− property var urlIconEmpty: widgetData["rating-icon-empty"]
102− property var urlIconFull: widgetData["rating-icon-full"]
93+ property var urlIconEmpty: widgetData["rating-icon-empty"] || "image://theme/non-starred"
94+ property var urlIconFull: widgetData["rating-icon-full"] || "image://theme/starred"
10395 }
10496 }
10597
@@ -131,10 +123,7 @@ PreviewWidget {
131123 Item {
132124 id: reviewSubmitContainer
133125 anchors {
134− top: reviewLabel.bottom
135− left: parent.left
136− right: parent.right
137− bottom: parent.bottom
126+ fill: parent
138127 topMargin: reviewContainer.innerMargin
139128 }
140129 implicitHeight: reviewTextArea.implicitHeight + anchors.topMargin
tests/qmltests/Dash/Previews/tst_PreviewRatingInput.qml+1−2
@@ -73,11 +73,10 @@ Rectangle {
7373
7474 function test_labels() {
7575 var ratingLabel = findChild(previewRatingInput, "ratingLabel");
76− var reviewLabel = findChild(previewRatingInput, "reviewLabel");
7776
7877 previewRatingInput.widgetData = widgetDataNewLabels;
7978 compare(ratingLabel.text, widgetDataNewLabels["rating-label"]);
80− compare(reviewLabel.text, widgetDataNewLabels["review-label"]);
79+ compare(reviewTextArea.placeholderText, widgetDataNewLabels["review-label"]);
8180 compare(submitButton.text, widgetDataNewLabels["submit-label"]);
8281 }
8382