@@ -41,11 +41,6 @@ Item {
42 property real viewWidth
42 property real viewWidth
45− \brief Scaling factor of selected Carousel item.
47− readonly property real carouselSelectedItemScaleFactor: 1.38 // XXX assuming 1.38 carousel scaling factor for cards
50 \brief Template supplied for the category.
45 \brief Template supplied for the category.
@@ -56,10 +51,25 @@ Item {
57 property var components
52 property var components
55+ \brief The Scope this cardTool is representing
57+ property string scopeId
60+ \brief The Scope category this cardTool is representing
62+ property string categoryId
65+ \brief Scaling factor of selected Carousel item.
67+ readonly property real carouselSelectedItemScaleFactor: 1.38 // XXX assuming 1.38 carousel scaling factor for cards
60 \brief The category layout for this card tool.
70 \brief The category layout for this card tool.
62− property string categoryLayout: {
72+ readonly property string categoryLayout: {
63 var layout = template["category-layout"];
73 var layout = template["category-layout"];
65 // carousel fallback mode to grid
75 // carousel fallback mode to grid
@@ -67,11 +77,19 @@ Item {
67 return layout;
77 return layout;
80+ readonly property bool isAppLikeScope: scopeId === "clickscope" || scopeId === "libertine-scope.ubuntu_libertine-scope"
81+ readonly property bool isAppLikeScopeAppCategory: ((scopeId === "clickscope" && (categoryId === "predefined" || categoryId === "local"))
82+ || (scopeId === "libertine-scope.ubuntu_libertine-scope" && categoryId !== "hint"))
71− // Not readonly because gets overwritten from GenericScopeView in some cases
84+ readonly property string artShapeStyle: {
85+ if (isAppLikeScope) {
86+ return isAppLikeScopeAppCategory ? "icon" : "flat";
72− property string artShapeStyle: categoryLayout === "carousel" ? "shadow" : "inset"
88+ return categoryLayout === "carousel" ? "shadow" : "inset"
74− property var cardComponent: CardCreatorCache.getCardComponent(cardTool.template, cardTool.components, false, cardTool.artShapeStyle, cardTool.categoryLayout);
92+ readonly property var cardComponent: CardCreatorCache.getCardComponent(cardTool.template, cardTool.components, false, cardTool.artShapeStyle, cardTool.categoryLayout);
76 // FIXME: Saviq
94 // FIXME: Saviq
77 // Only way for the card below to actually be laid out completely.
95 // Only way for the card below to actually be laid out completely.
@@ -85,7 +103,19 @@ Item {
86 If -1, should use implicit width of the actual card.
104 If -1, should use implicit width of the actual card.
88− property real cardWidth: {
106+ readonly property real cardWidth: {
107+ if (isAppLikeScopeAppCategory) {
108+ if (viewWidth > units.gu(45)) {
109+ if (viewWidth >= units.gu(70)) {
110+ return units.gu(11);
112+ return units.gu(10);
115+ return units.gu(12);
89 switch (categoryLayout) {
119 switch (categoryLayout) {
90 case "grid":
120 case "grid":
91 case "vertical-journal":
121 case "vertical-journal":
@@ -142,12 +172,19 @@ Item {
142 type:real \brief Height of the card's header.
172 type:real \brief Height of the card's header.
144 readonly property int headerHeight: cardLoader.item ? cardLoader.item.headerHeight : 0
174 readonly property int headerHeight: cardLoader.item ? cardLoader.item.headerHeight : 0
176+ readonly property size artShapeSize: {
177+ if (isAppLikeScopeAppCategory) {
178+ return Qt.size(units.gu(8), units.gu(7.5));
145− property size artShapeSize: cardLoader.item ? cardLoader.item.artShapeSize : Qt.size(0, 0)
180+ return cardLoader.item ? cardLoader.item.artShapeSize : Qt.size(0, 0)
147 QtObject {
184 QtObject {
148 id: carouselTool
185 id: carouselTool
150− property real minimumTileWidth: {
187+ readonly property real minimumTileWidth: {
151 if (cardTool.viewWidth === undefined) return undefined;
188 if (cardTool.viewWidth === undefined) return undefined;
152 if (cardTool.viewWidth <= units.gu(40)) return units.gu(18);
189 if (cardTool.viewWidth <= units.gu(40)) return units.gu(18);
153 if (cardTool.viewWidth >= units.gu(128)) return units.gu(26);
190 if (cardTool.viewWidth >= units.gu(128)) return units.gu(26);
@@ -156,7 +193,7 @@ Item {
157 readonly property real pathItemCount: 4.8457 /// (848 / 175) reference values
194 readonly property real pathItemCount: 4.8457 /// (848 / 175) reference values
159− property real realPathItemCount: {
196+ readonly property real realPathItemCount: {
160 var scaledMinimumTileWidth = minimumTileWidth / cardTool.carouselSelectedItemScaleFactor;
197 var scaledMinimumTileWidth = minimumTileWidth / cardTool.carouselSelectedItemScaleFactor;
161 var tileWidth = Math.max(cardTool.viewWidth / pathItemCount, scaledMinimumTileWidth);
198 var tileWidth = Math.max(cardTool.viewWidth / pathItemCount, scaledMinimumTileWidth);
162 return Math.min(cardTool.viewWidth / tileWidth, pathItemCount);
199 return Math.min(cardTool.viewWidth / tileWidth, pathItemCount);