@@ -67,7 +67,11 @@ Rectangle {
6767 {
6868 "name": "Art, header, summary - horizontal",
6969 "layout": { "template": { "card-layout": "horizontal" }, "components": JSON.parse(Helpers.fullMapping) }
70− }
70+ },
71+ {
72+ "name": "Art, header - portrait",
73+ "layout": { "components": Helpers.update(JSON.parse(Helpers.fullMapping), { "art": {"aspect-ratio": 0.5, "summary": undefined }}) }
74+ },
7175 ]
7276
7377 CardTool {
@@ -75,6 +79,7 @@ Rectangle {
7579
7680 template: Helpers.update(JSON.parse(Helpers.defaultLayout), Helpers.tryParse(layoutArea.text, layoutError))['template'];
7781 components: Helpers.update(JSON.parse(Helpers.defaultLayout), Helpers.tryParse(layoutArea.text, layoutError))['components'];
82+ viewWidth: units.gu(Math.round(widthSlider.value))
7883 }
7984
8085 Column {
@@ -83,6 +88,7 @@ Rectangle {
8388
8489 Repeater {
8590 model: [
91+ { label: "View width", value: cardTool.viewWidth && cardTool.viewWidth / units.gu(1) },
8692 { label: "Card width", value: cardTool.cardWidth && cardTool.cardWidth / units.gu(1) },
8793 { label: "Card height", value: cardTool.cardHeight && cardTool.cardHeight / units.gu(1) },
8894 ]
@@ -158,6 +164,7 @@ Rectangle {
158164 { label: "Organic Grid", layout: "organic-grid" },
159165 { label: "Horizontal Journal", layout: "journal" },
160166 { label: "Vertical Journal", layout: "vertical-journal" },
167+ { label: "Carousel", layout: "carousel" },
161168 ]
162169 delegate: OptionSelectorDelegate { text: modelData.label }
163170 onSelectedIndexChanged: {
@@ -170,6 +177,21 @@ Rectangle {
170177 }
171178 }
172179
180+ Label {
181+ anchors { left: parent.left; right: parent.right }
182+ height: units.gu(3)
183+ verticalAlignment: Text.AlignBottom
184+ text: "View width:"
185+ }
186+
187+ Slider {
188+ id: widthSlider
189+ minimumValue: 30
190+ maximumValue: 140
191+ live: true
192+ value: 40
193+ }
194+
173195 TextArea {
174196 id: layoutArea
175197 anchors { left: parent.left; right: parent.right }
@@ -205,6 +227,7 @@ Rectangle {
205227 case "organic-grid": layoutSelector.selectedIndex = 1; break;
206228 case "journal": layoutSelector.selectedIndex = 2; break;
207229 case "vertical-journal": layoutSelector.selectedIndex = 3; break;
230+ case "carousel": layoutSelector.selectedIndex = 4; break;
208231 case "grid":
209232 default: layoutSelector.selectedIndex = 0; break;
210233 }
@@ -239,6 +262,10 @@ Rectangle {
239262 { tag: "Journal", width: undefined, height: units.gu(20), size: 20, index: 0, layout_index: 2 },
240263 { tag: "OversizedJournal", width: undefined, height: units.gu(18.5), size: 40, index: 0, layout_index: 2 },
241264 { tag: "VerticalJournal", width: units.gu(18.5), height: undefined, index: 0, layout_index: 3 },
265+ { tag: "SmallCarousel", width: units.gu(18), height: units.gu(18), viewWidth: 30, index: 0, layout_index: 4},
266+ { tag: "MediumCarousel", width: units.gu(22), height: units.gu(22), viewWidth: 84, index: 0, layout_index: 4},
267+ { tag: "LargeCarousel", width: units.gu(26), height: units.gu(26), viewWidth: 140, index: 0, layout_index: 4},
268+ { tag: "PortraitCarousel", width: units.gu(22), height: units.gu(44), viewWidth: 84, index: 10, layout_index: 4},
242269 ]
243270 }
244271
@@ -248,6 +275,10 @@ Rectangle {
248275 layoutSelector.selectedIndex = data.layout_index;
249276 }
250277
278+ if (data.hasOwnProperty("viewWidth")) {
279+ widthSlider.value = data.viewWidth;
280+ }
281+
251282 if (data.hasOwnProperty("size")) {
252283 cardTool.template['card-size'] = data.size;
253284 cardTool.templateChanged();