on xenial help sign in
Make the card sizes a bit dependant on the total of gu of the dash
879503fAlbert Astals Cid
qml/Dash/CardTool.qml+15−6
@@ -80,16 +80,25 @@ Item {
80
80
81 If undefined, should use implicit width of the actual card.
81 If undefined, should use implicit width of the actual card.
82 */
82 */
83− readonly property var cardWidth: {
83+ property var cardWidth: {
84 switch (categoryLayout) {
84 switch (categoryLayout) {
85 case "grid":
85 case "grid":
86 case "vertical-journal":
86 case "vertical-journal":
87+ var size = template["card-size"];
87− if (template["card-layout"] === "horizontal") return units.gu(38);
88+ if (template["card-layout"] === "horizontal") size = "large";
88− switch (template["card-size"]) {
89+ switch (size) {
89− case "small": return units.gu(12);
90+ case "small": {
91+ if (viewWidth <= units.gu(45)) return units.gu(12);
92+ else return units.gu(14);
93+ }
90− case "large": return units.gu(38);
94+ case "large": {
95+ if (viewWidth >= units.gu(70)) return units.gu(42);
96+ else return viewWidth - units.gu(2);
97+ }
91 }
98 }
92− return units.gu(18.5);
99+ if (viewWidth <= units.gu(45)) return units.gu(18);
100+ else if (viewWidth >= units.gu(70)) return units.gu(20);
101+ else return units.gu(23);
93 case "carousel":
102 case "carousel":
94 case "horizontal-list":
103 case "horizontal-list":
95 return carouselTool.minimumTileWidth;
104 return carouselTool.minimumTileWidth;
qml/Dash/GenericScopeView.qml+7
@@ -332,6 +332,13 @@ FocusScope {
332 updateRanges();
332 updateRanges();
333 if (scope && scope.id === "clickscope" && (categoryId === "predefined" || categoryId === "local")) {
333 if (scope && scope.id === "clickscope" && (categoryId === "predefined" || categoryId === "local")) {
334 // Yeah, hackish :/
334 // Yeah, hackish :/
335+ if (scopeView.width > units.gu(45)) {
336+ if (scopeView.width >= units.gu(70)) {
337+ cardTool.cardWidth = units.gu(9);
338+ } else {
339+ cardTool.cardWidth = units.gu(10);
340+ }
341+ }
335 cardTool.artShapeSize = Qt.size(units.gu(8), units.gu(7.5));
342 cardTool.artShapeSize = Qt.size(units.gu(8), units.gu(7.5));
336 }
343 }
337 item.cardTool = cardTool;
344 item.cardTool = cardTool;