on xenial help sign in
update AppPreview and GenericPreview to changes in DashPreview
3222e0cMichael Zanetti
Dash/Apps/AppPreview.qml+43−53
@@ -26,15 +26,10 @@ DashPreview {
26
26
27 signal sendUserReview(string review)
27 signal sendUserReview(string review)
28
28
29− header: ListView {
29+ previewImages: ListView {
30 spacing: units.gu(1)
30 spacing: units.gu(1)
31 orientation: ListView.Horizontal
31 orientation: ListView.Horizontal
32 height: units.gu(22)
32 height: units.gu(22)
33− anchors {
34− left: parent.left
35− right: parent.right
36− margins: units.gu(1)
37− }
38 model: previewData.infoMap["more-screenshots"] != null ? previewData.infoMap["more-screenshots"].value : [previewData.image]
33 model: previewData.infoMap["more-screenshots"] != null ? previewData.infoMap["more-screenshots"].value : [previewData.image]
39
34
40 delegate: UbuntuShape {
35 delegate: UbuntuShape {
@@ -55,14 +50,8 @@ DashPreview {
55 }
50 }
56 }
51 }
57
52
58− title: AppInfo {
53+ header: AppInfo {
59 objectName: "appInfo"
54 objectName: "appInfo"
60− anchors {
61− top: parent.top
62− topMargin: units.gu(2)
63− left: parent.left
64− right: parent.right
65− }
66
55
67 appName: root.previewData.title
56 appName: root.previewData.title
68 icon: root.previewData.appIcon
57 icon: root.previewData.appIcon
@@ -133,7 +122,7 @@ DashPreview {
133 }
122 }
134 }
123 }
135
124
136− buttons: Loader {
125+ actions: Loader {
137 anchors {
126 anchors {
138 left: parent.left
127 left: parent.left
139 right: parent.right
128 right: parent.right
@@ -146,7 +135,7 @@ DashPreview {
146 }
135 }
147 }
136 }
148
137
149− body: Column {
138+ description: Column {
150 spacing: units.gu(1)
139 spacing: units.gu(1)
151
140
152 Label {
141 Label {
@@ -160,53 +149,54 @@ DashPreview {
160 styleColor: "black"
149 styleColor: "black"
161 }
150 }
162
151
152+ }
163− Column {
153+ ratings: Column {
164− visible: root.previewData.rating >= 0
154+ visible: root.previewData.rating >= 0
165− anchors { left: parent.left; right: parent.right }
166− spacing: parent.spacing
155+ spacing: units.gu(1)
167−
168− ListItem.ThinDivider { }
169−
170− Item {
171− anchors { left: parent.left; right: parent.right }
172− height: rateLabel.height
156+ height: childrenRect.height
173
157
174− Label {
158+ ListItem.ThinDivider { }
175− id: rateLabel
176− fontSize: "medium"
177− color: "white"
178− style: Text.Raised
179− styleColor: "black"
180− opacity: .9
181− text: i18n.tr("Rate this")
182
159
160+ Item {
161+ anchors { left: parent.left; right: parent.right }
162+ height: rateLabel.height
163+
164+ Label {
165+ id: rateLabel
166+ fontSize: "medium"
167+ color: "white"
168+ style: Text.Raised
169+ styleColor: "black"
170+ opacity: .9
171+ text: i18n.tr("Rate this")
172+
183− anchors.left: parent.left
173+ anchors.left: parent.left
184− anchors.verticalCenter: parent.verticalCenter
174+ anchors.verticalCenter: parent.verticalCenter
185− }
175+ }
186
176
187− // FIXME these need to be made interactive and connected to the scope
177+ // FIXME these need to be made interactive and connected to the scope
188− RatingStars {
178+ RatingStars {
189− anchors.right: parent.right
179+ anchors.right: parent.right
190− anchors.verticalCenter: parent.verticalCenter
180+ anchors.verticalCenter: parent.verticalCenter
191− }
192 }
181 }
182+ }
193
183
194− ListItem.ThinDivider { }
184+ ListItem.ThinDivider { }
195
185
196− AppReviews {
186+ AppReviews {
197− id: appReviews
187+ id: appReviews
198− objectName: "appReviews"
188+ objectName: "appReviews"
199− // TODO: This should make this visible when the feature for reviews/comments is complete.
189+ // TODO: This should make this visible when the feature for reviews/comments is complete.
200− visible: false
190+ visible: false; height: 0
201− anchors { left: parent.left; right: parent.right }
202
191
203− model: root.previewData.infoMap["comments"] ? root.previewData.infoMap["comments"].value : undefined
192+ anchors { left: parent.left; right: parent.right }
204
193
205− onSendReview: root.sendUserReview(review);
194+ model: root.previewData.infoMap["comments"] ? root.previewData.infoMap["comments"].value : undefined
206
195
196+ onSendReview: root.sendUserReview(review);
197+
207− onEditing: {
198+ onEditing: {
208− root.ensureVisible(appReviews.textArea);
199+ root.ensureVisible(appReviews.textArea);
209− }
210 }
200 }
211 }
201 }
212 }
202 }
Dash/DashPreview.qml+1−1
@@ -90,7 +90,7 @@ Rectangle {
90 width: root.columnWidth
90 width: root.columnWidth
91 contentHeight: leftColumn.height
91 contentHeight: leftColumn.height
92 anchors.bottomMargin: root.keyboardSize
92 anchors.bottomMargin: root.keyboardSize
93− //clip: true
93+ clip: true
94
94
95 Behavior on contentY { NumberAnimation { duration: 300 } }
95 Behavior on contentY { NumberAnimation { duration: 300 } }
96
96
Dash/Generic/GenericPreview.qml+7−12
@@ -27,7 +27,7 @@ DashPreview {
27
27
28 property url url: previewData.image
28 property url url: previewData.image
29
29
30− header: UbuntuShape {
30+ previewImages: UbuntuShape {
31 id: urlLoader
31 id: urlLoader
32 anchors.left: parent.left
32 anchors.left: parent.left
33 anchors.right: parent.right
33 anchors.right: parent.right
@@ -41,13 +41,8 @@ DashPreview {
41 }
41 }
42 }
42 }
43
43
44− title: Column {
44+ header: Column {
45− anchors {
45+ height: childrenRect.height
46− top: parent.top
47− topMargin: units.gu(2)
48− left: parent.left
49− right: parent.right
50− }
51
46
52 Label {
47 Label {
53 id: title
48 id: title
@@ -55,7 +50,7 @@ DashPreview {
55 anchors { left: parent.left; right: parent.right }
50 anchors { left: parent.left; right: parent.right }
56
51
57 elide: Text.ElideRight
52 elide: Text.ElideRight
58− fontSize: "x-large"
53+ fontSize: "large"
59 font.weight: Font.Light
54 font.weight: Font.Light
60 color: Theme.palette.selected.backgroundText
55 color: Theme.palette.selected.backgroundText
61 opacity: 0.9
56 opacity: 0.9
@@ -69,7 +64,7 @@ DashPreview {
69 Label {
64 Label {
70 anchors { left: parent.left; right: parent.right }
65 anchors { left: parent.left; right: parent.right }
71 visible: text != ""
66 visible: text != ""
72− fontSize: "medium"
67+ fontSize: "small"
73 opacity: 0.6
68 opacity: 0.6
74 color: "white"
69 color: "white"
75 text: previewData.subtitle.replace(/[\r\n]+/g, "<br />")
70 text: previewData.subtitle.replace(/[\r\n]+/g, "<br />")
@@ -82,7 +77,7 @@ DashPreview {
82 onWidthChanged: { wrapMode = Text.NoWrap; wrapMode = Text.WordWrap }
77 onWidthChanged: { wrapMode = Text.NoWrap; wrapMode = Text.WordWrap }
83 }
78 }
84 }
79 }
85− buttons: GridView {
80+ actions: GridView {
86 id: buttons
81 id: buttons
87 model: genericPreview.previewData.actions
82 model: genericPreview.previewData.actions
88
83
@@ -112,7 +107,7 @@ DashPreview {
112 focus: false
107 focus: false
113 }
108 }
114
109
115− body: Column {
110+ description: Column {
116 spacing: units.gu(2)
111 spacing: units.gu(2)
117
112
118 Label {
113 Label {