on xenial help sign in
Move all review related items into a single group
dc488a7Michal Hruby
Dash/Apps/AppPreview.qml+33−36
@@ -25,8 +25,6 @@ import "../../Components/IconUtil.js" as IconUtil
25DashPreview {
25DashPreview {
26 id: root
26 id: root
27
27
28− property bool canBeRated: root.previewData.rating >= 0.0
29−
30 signal sendUserReview(string review)
28 signal sendUserReview(string review)
31
29
32 title: root.previewData.title
30 title: root.previewData.title
@@ -156,48 +154,47 @@ DashPreview {
156 styleColor: "black"
154 styleColor: "black"
157 }
155 }
158
156
159− ListItem.ThinDivider {
160− visible: root.canBeRated
161− }
162−
163 Item {
157 Item {
164− visible: root.canBeRated
158+ visible: root.previewData.rating >= 0
165 anchors { left: parent.left; right: parent.right }
159 anchors { left: parent.left; right: parent.right }
166− height: rateLabel.height
160+ height: childrenRect.height
167−
168− Label {
169− id: rateLabel
170− fontSize: "medium"
171− color: "white"
172− style: Text.Raised
173− styleColor: "black"
174− opacity: .9
175− text: i18n.tr("Rate this")
176−
177− anchors.left: parent.left
178− anchors.verticalCenter: parent.verticalCenter
179− }
180
161
162+ ListItem.ThinDivider { }
163+
164+ Item {
165+ anchors { left: parent.left; right: parent.right }
166+ height: rateLabel.height
167+
168+ Label {
169+ id: rateLabel
170+ fontSize: "medium"
171+ color: "white"
172+ style: Text.Raised
173+ styleColor: "black"
174+ opacity: .9
175+ text: i18n.tr("Rate this")
176+
177+ anchors.left: parent.left
178+ anchors.verticalCenter: parent.verticalCenter
179+ }
180+
181− // FIXME these need to be made interactive and connected to the scope
181+ // FIXME these need to be made interactive and connected to the scope
182− RatingStars {
182+ RatingStars {
183− anchors.right: parent.right
183+ anchors.right: parent.right
184− anchors.verticalCenter: parent.verticalCenter
184+ anchors.verticalCenter: parent.verticalCenter
185+ }
185 }
186 }
186− }
187
187
188− ListItem.ThinDivider {
188+ ListItem.ThinDivider { }
189− visible: root.canBeRated
190− }
191
189
192− AppReviews {
190+ AppReviews {
193− visible: root.canBeRated
194− objectName: "appReviews"
191+ objectName: "appReviews"
195− anchors { left: parent.left; right: parent.right }
192+ anchors { left: parent.left; right: parent.right }
196
193
197− model: root.previewData.infoMap["comments"] ? root.previewData.infoMap["comments"].value : undefined
194+ model: root.previewData.infoMap["comments"] ? root.previewData.infoMap["comments"].value : undefined
198
195
199− onSendReview: root.sendUserReview(review);
196+ onSendReview: root.sendUserReview(review);
197+ }
200 }
198 }
201−
202 }
199 }
203}
200}