@@ -67,7 +67,11 @@ Rectangle {
68 "name": "Art, header, summary - horizontal",
68 "name": "Art, header, summary - horizontal",
69 "layout": { "template": { "card-layout": "horizontal" }, "components": JSON.parse(Helpers.fullMapping) }
69 "layout": { "template": { "card-layout": "horizontal" }, "components": JSON.parse(Helpers.fullMapping) }
72+ "name": "Art, header - portrait",
73+ "layout": { "components": Helpers.update(JSON.parse(Helpers.fullMapping), { "art": {"aspect-ratio": 0.5, "summary": undefined }}) }
73 CardTool {
77 CardTool {
@@ -75,6 +79,7 @@ Rectangle {
76 template: Helpers.update(JSON.parse(Helpers.defaultLayout), Helpers.tryParse(layoutArea.text, layoutError))['template'];
80 template: Helpers.update(JSON.parse(Helpers.defaultLayout), Helpers.tryParse(layoutArea.text, layoutError))['template'];
77 components: Helpers.update(JSON.parse(Helpers.defaultLayout), Helpers.tryParse(layoutArea.text, layoutError))['components'];
81 components: Helpers.update(JSON.parse(Helpers.defaultLayout), Helpers.tryParse(layoutArea.text, layoutError))['components'];
82+ viewWidth: units.gu(Math.round(widthSlider.value))
@@ -83,6 +88,7 @@ Rectangle {
84 Repeater {
89 Repeater {
91+ { label: "View width", value: cardTool.viewWidth && cardTool.viewWidth / units.gu(1) },
86 { label: "Card width", value: cardTool.cardWidth && cardTool.cardWidth / units.gu(1) },
92 { label: "Card width", value: cardTool.cardWidth && cardTool.cardWidth / units.gu(1) },
87 { label: "Card height", value: cardTool.cardHeight && cardTool.cardHeight / units.gu(1) },
93 { label: "Card height", value: cardTool.cardHeight && cardTool.cardHeight / units.gu(1) },
@@ -158,6 +164,7 @@ Rectangle {
158 { label: "Organic Grid", layout: "organic-grid" },
164 { label: "Organic Grid", layout: "organic-grid" },
159 { label: "Horizontal Journal", layout: "journal" },
165 { label: "Horizontal Journal", layout: "journal" },
160 { label: "Vertical Journal", layout: "vertical-journal" },
166 { label: "Vertical Journal", layout: "vertical-journal" },
167+ { label: "Carousel", layout: "carousel" },
162 delegate: OptionSelectorDelegate { text: modelData.label }
169 delegate: OptionSelectorDelegate { text: modelData.label }
163 onSelectedIndexChanged: {
170 onSelectedIndexChanged: {
@@ -170,6 +177,21 @@ Rectangle {
181+ anchors { left: parent.left; right: parent.right }
183+ verticalAlignment: Text.AlignBottom
173 TextArea {
195 TextArea {
174 id: layoutArea
196 id: layoutArea
175 anchors { left: parent.left; right: parent.right }
197 anchors { left: parent.left; right: parent.right }
@@ -205,6 +227,7 @@ Rectangle {
205 case "organic-grid": layoutSelector.selectedIndex = 1; break;
227 case "organic-grid": layoutSelector.selectedIndex = 1; break;
206 case "journal": layoutSelector.selectedIndex = 2; break;
228 case "journal": layoutSelector.selectedIndex = 2; break;
207 case "vertical-journal": layoutSelector.selectedIndex = 3; break;
229 case "vertical-journal": layoutSelector.selectedIndex = 3; break;
230+ case "carousel": layoutSelector.selectedIndex = 4; break;
208 case "grid":
231 case "grid":
209 default: layoutSelector.selectedIndex = 0; break;
232 default: layoutSelector.selectedIndex = 0; break;
@@ -239,6 +262,10 @@ Rectangle {
239 { tag: "Journal", width: undefined, height: units.gu(20), size: 20, index: 0, layout_index: 2 },
262 { tag: "Journal", width: undefined, height: units.gu(20), size: 20, index: 0, layout_index: 2 },
240 { tag: "OversizedJournal", width: undefined, height: units.gu(18.5), size: 40, index: 0, layout_index: 2 },
263 { tag: "OversizedJournal", width: undefined, height: units.gu(18.5), size: 40, index: 0, layout_index: 2 },
241 { tag: "VerticalJournal", width: units.gu(18.5), height: undefined, index: 0, layout_index: 3 },
264 { 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},
@@ -248,6 +275,10 @@ Rectangle {
248 layoutSelector.selectedIndex = data.layout_index;
275 layoutSelector.selectedIndex = data.layout_index;
278+ if (data.hasOwnProperty("viewWidth")) {
279+ widthSlider.value = data.viewWidth;
251 if (data.hasOwnProperty("size")) {
282 if (data.hasOwnProperty("size")) {
252 cardTool.template['card-size'] = data.size;
283 cardTool.template['card-size'] = data.size;
253 cardTool.templateChanged();
284 cardTool.templateChanged();