on xenial help sign in
Merge lp:~aacid/unity8/new-scopes-carousel-as-grid
95f181eAlbert Astals
qml/Dash/CardFilterGrid.qml+3
@@ -29,6 +29,9 @@ DashFilterGrid {
29 id: cardTool
29 id: cardTool
30
30
31 template: genericFilterGrid.template
31 template: genericFilterGrid.template
32+ // We can't trust the template since it may happen it is carousel
33+ // that is being should as a grid because of the lack of elements
34+ categoryLayout: "grid"
32 components: genericFilterGrid.components
35 components: genericFilterGrid.components
33 }
36 }
34
37
qml/Dash/CardTool.qml+7−2
@@ -43,6 +43,11 @@ Item {
43 */
43 */
44 property var viewWidth
44 property var viewWidth
45
45
46+ /*!
47+ \brief The category layout for this card tool
48+ */
49+ property string categoryLayout: template ? template["category-layout"] : ""
50+
46 // FIXME: Saviq
51 // FIXME: Saviq
47 // Only way for the card below to actually be laid out completely.
52 // Only way for the card below to actually be laid out completely.
48 // If invisible or in "data" array, some components are not taken into account.
53 // If invisible or in "data" array, some components are not taken into account.
@@ -56,7 +61,7 @@ Item {
56 If undefined, should use implicit width of the actual card.
61 If undefined, should use implicit width of the actual card.
57 */
62 */
58 readonly property var cardWidth: {
63 readonly property var cardWidth: {
59− switch (template !== undefined && template["category-layout"]) {
64+ switch (categoryLayout) {
60 case "grid":
65 case "grid":
61 case "vertical-journal":
66 case "vertical-journal":
62 if (template["card-layout"] === "horizontal") return units.gu(38);
67 if (template["card-layout"] === "horizontal") return units.gu(38);
@@ -84,7 +89,7 @@ Item {
84 If undefined, should use implicit height of the actual card.
89 If undefined, should use implicit height of the actual card.
85 */
90 */
86 readonly property var cardHeight: {
91 readonly property var cardHeight: {
87− switch (template !== undefined && template["category-layout"]) {
92+ switch (categoryLayout) {
88 case "journal":
93 case "journal":
89 if (template["card-size"] >= 12 && template["card-size"] <= 38) return units.gu(template["card-size"]);
94 if (template["card-size"] >= 12 && template["card-size"] <= 38) return units.gu(template["card-size"]);
90 return units.gu(18.5);
95 return units.gu(18.5);