on xenial help sign in
update AppPreview and GenericPreview to changes in DashPreview
commit3222e0cae3dff80de040742df36c726a92fbef79 authorMichael Zanetti <michael.zanetti@canonical.com> dateMon 30 Sep 2013, 16:54 (13 years ago) parent526899b
3 files changed+51−66
Dash/Apps/AppPreview.qml+43−53 Dash/DashPreview.qml+1−1 Dash/Generic/GenericPreview.qml+7−12
Dash/Apps/AppPreview.qml+43−53
@@ -26,15 +26,10 @@ DashPreview {
2626
2727 signal sendUserReview(string review)
2828
29− header: ListView {
29+ previewImages: ListView {
3030 spacing: units.gu(1)
3131 orientation: ListView.Horizontal
3232 height: units.gu(22)
33− anchors {
34− left: parent.left
35− right: parent.right
36− margins: units.gu(1)
37− }
3833 model: previewData.infoMap["more-screenshots"] != null ? previewData.infoMap["more-screenshots"].value : [previewData.image]
3934
4035 delegate: UbuntuShape {
@@ -55,14 +50,8 @@ DashPreview {
5550 }
5651 }
5752
58− title: AppInfo {
53+ header: AppInfo {
5954 objectName: "appInfo"
60− anchors {
61− top: parent.top
62− topMargin: units.gu(2)
63− left: parent.left
64− right: parent.right
65− }
6655
6756 appName: root.previewData.title
6857 icon: root.previewData.appIcon
@@ -133,7 +122,7 @@ DashPreview {
133122 }
134123 }
135124
136− buttons: Loader {
125+ actions: Loader {
137126 anchors {
138127 left: parent.left
139128 right: parent.right
@@ -146,7 +135,7 @@ DashPreview {
146135 }
147136 }
148137
149− body: Column {
138+ description: Column {
150139 spacing: units.gu(1)
151140
152141 Label {
@@ -160,53 +149,54 @@ DashPreview {
160149 styleColor: "black"
161150 }
162151
163− Column {
164− visible: root.previewData.rating >= 0
165− anchors { left: parent.left; right: parent.right }
166− spacing: parent.spacing
167−
168− ListItem.ThinDivider { }
169−
170− Item {
171− anchors { left: parent.left; right: parent.right }
172− height: rateLabel.height
152+ }
153+ ratings: Column {
154+ visible: root.previewData.rating >= 0
155+ spacing: units.gu(1)
156+ height: childrenRect.height
173157
174− Label {
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")
158+ ListItem.ThinDivider { }
182159
183− anchors.left: parent.left
184− anchors.verticalCenter: parent.verticalCenter
185− }
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+
173+ anchors.left: parent.left
174+ anchors.verticalCenter: parent.verticalCenter
175+ }
186176
187− // FIXME these need to be made interactive and connected to the scope
188− RatingStars {
189− anchors.right: parent.right
190− anchors.verticalCenter: parent.verticalCenter
191− }
177+ // FIXME these need to be made interactive and connected to the scope
178+ RatingStars {
179+ anchors.right: parent.right
180+ anchors.verticalCenter: parent.verticalCenter
192181 }
182+ }
193183
194− ListItem.ThinDivider { }
184+ ListItem.ThinDivider { }
195185
196− AppReviews {
197− id: appReviews
198− objectName: "appReviews"
199− // TODO: This should make this visible when the feature for reviews/comments is complete.
200− visible: false
201− anchors { left: parent.left; right: parent.right }
186+ AppReviews {
187+ id: appReviews
188+ objectName: "appReviews"
189+ // TODO: This should make this visible when the feature for reviews/comments is complete.
190+ visible: false; height: 0
202191
203− model: root.previewData.infoMap["comments"] ? root.previewData.infoMap["comments"].value : undefined
192+ anchors { left: parent.left; right: parent.right }
204193
205− onSendReview: root.sendUserReview(review);
194+ model: root.previewData.infoMap["comments"] ? root.previewData.infoMap["comments"].value : undefined
206195
207− onEditing: {
208− root.ensureVisible(appReviews.textArea);
209− }
196+ onSendReview: root.sendUserReview(review);
197+
198+ onEditing: {
199+ root.ensureVisible(appReviews.textArea);
210200 }
211201 }
212202 }
Dash/DashPreview.qml+1−1
@@ -90,7 +90,7 @@ Rectangle {
9090 width: root.columnWidth
9191 contentHeight: leftColumn.height
9292 anchors.bottomMargin: root.keyboardSize
93− //clip: true
93+ clip: true
9494
9595 Behavior on contentY { NumberAnimation { duration: 300 } }
9696
Dash/Generic/GenericPreview.qml+7−12
@@ -27,7 +27,7 @@ DashPreview {
2727
2828 property url url: previewData.image
2929
30− header: UbuntuShape {
30+ previewImages: UbuntuShape {
3131 id: urlLoader
3232 anchors.left: parent.left
3333 anchors.right: parent.right
@@ -41,13 +41,8 @@ DashPreview {
4141 }
4242 }
4343
44− title: Column {
45− anchors {
46− top: parent.top
47− topMargin: units.gu(2)
48− left: parent.left
49− right: parent.right
50− }
44+ header: Column {
45+ height: childrenRect.height
5146
5247 Label {
5348 id: title
@@ -55,7 +50,7 @@ DashPreview {
5550 anchors { left: parent.left; right: parent.right }
5651
5752 elide: Text.ElideRight
58− fontSize: "x-large"
53+ fontSize: "large"
5954 font.weight: Font.Light
6055 color: Theme.palette.selected.backgroundText
6156 opacity: 0.9
@@ -69,7 +64,7 @@ DashPreview {
6964 Label {
7065 anchors { left: parent.left; right: parent.right }
7166 visible: text != ""
72− fontSize: "medium"
67+ fontSize: "small"
7368 opacity: 0.6
7469 color: "white"
7570 text: previewData.subtitle.replace(/[\r\n]+/g, "<br />")
@@ -82,7 +77,7 @@ DashPreview {
8277 onWidthChanged: { wrapMode = Text.NoWrap; wrapMode = Text.WordWrap }
8378 }
8479 }
85− buttons: GridView {
80+ actions: GridView {
8681 id: buttons
8782 model: genericPreview.previewData.actions
8883
@@ -112,7 +107,7 @@ DashPreview {
112107 focus: false
113108 }
114109
115− body: Column {
110+ description: Column {
116111 spacing: units.gu(2)
117112
118113 Label {