on xenial help sign in
Merge lp:~aacid/unity8/new-scopes-carousel-as-grid
commit95f181e84d10696110c67b4f8dcad4829b3687d4 authorAlbert Astals <albert.astals@canonical.com> dateThu 13 Feb 2014, 13:30 (13 years ago) parentfa758b202bf242
2 files changed+10−2
qml/Dash/CardFilterGrid.qml+3 qml/Dash/CardTool.qml+7−2
qml/Dash/CardFilterGrid.qml+3
@@ -29,6 +29,9 @@ DashFilterGrid {
2929 id: cardTool
3030
3131 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"
3235 components: genericFilterGrid.components
3336 }
3437
qml/Dash/CardTool.qml+7−2
@@ -43,6 +43,11 @@ Item {
4343 */
4444 property var viewWidth
4545
46+ /*!
47+ \brief The category layout for this card tool
48+ */
49+ property string categoryLayout: template ? template["category-layout"] : ""
50+
4651 // FIXME: Saviq
4752 // Only way for the card below to actually be laid out completely.
4853 // If invisible or in "data" array, some components are not taken into account.
@@ -56,7 +61,7 @@ Item {
5661 If undefined, should use implicit width of the actual card.
5762 */
5863 readonly property var cardWidth: {
59− switch (template !== undefined && template["category-layout"]) {
64+ switch (categoryLayout) {
6065 case "grid":
6166 case "vertical-journal":
6267 if (template["card-layout"] === "horizontal") return units.gu(38);
@@ -84,7 +89,7 @@ Item {
8489 If undefined, should use implicit height of the actual card.
8590 */
8691 readonly property var cardHeight: {
87− switch (template !== undefined && template["category-layout"]) {
92+ switch (categoryLayout) {
8893 case "journal":
8994 if (template["card-size"] >= 12 && template["card-size"] <= 38) return units.gu(template["card-size"]);
9095 return units.gu(18.5);