on xenial help sign in
Merge titleAlignmentOnCompileTime
04aff45Albert Astals Cid
plugins/Dash/CardCreator.js+18−3
@@ -287,6 +287,7 @@ var kMascotImageCode = 'CroppedImageMinimumSourceSize { \n\
287// %2 is used as color of titleLabel
287// %2 is used as color of titleLabel
288// %3 is used as extra condition for visible of titleLabel
288// %3 is used as extra condition for visible of titleLabel
289// %4 is used as title width
289// %4 is used as title width
290+// %5 is used as horizontal alignment
290var kTitleLabelCode = 'Label { \n\
291var kTitleLabelCode = 'Label { \n\
291 id: titleLabel; \n\
292 id: titleLabel; \n\
292 objectName: "titleLabel"; \n\
293 objectName: "titleLabel"; \n\
@@ -301,7 +302,7 @@ var kTitleLabelCode = 'Label { \n\
301 width: %4; \n\
302 width: %4; \n\
302 text: root.title; \n\
303 text: root.title; \n\
303 font.weight: cardData && cardData["subtitle"] ? Font.DemiBold : Font.Normal; \n\
304 font.weight: cardData && cardData["subtitle"] ? Font.DemiBold : Font.Normal; \n\
304− horizontalAlignment: root.titleAlignment; \n\
305+ horizontalAlignment: %5; \n\
305 }\n';
306 }\n';
306
307
307// %1 is used as extra anchors of emblemIcon
308// %1 is used as extra anchors of emblemIcon
@@ -422,7 +423,6 @@ function cardString(template, components, isCardTool) {
422 property string backgroundShapeStyle: "inset"; \n\
423 property string backgroundShapeStyle: "inset"; \n\
423 property real fontScale: 1.0; \n\
424 property real fontScale: 1.0; \n\
424 property var scopeStyle: null; \n\
425 property var scopeStyle: null; \n\
425− property int titleAlignment: Text.AlignLeft; \n\
426 %2\
426 %2\
427 property size fixedArtShapeSize: Qt.size(-1, -1); \n\
427 property size fixedArtShapeSize: Qt.size(-1, -1); \n\
428 readonly property string title: cardData && cardData["title"] || ""; \n\
428 readonly property string title: cardData && cardData["title"] || ""; \n\
@@ -746,9 +746,24 @@ function cardString(template, components, isCardTool) {
746 }
746 }
747 }
747 }
748
748
749+ var titleAlignment = "Text.AlignHCenter";
750+ if (template["card-layout"] === "horizontal"
751+ || typeof components["title"] !== "object"
752+ || components["title"]["align"] === "left") titleAlignment = "Text.AlignLeft";
753+ var keys = ["mascot", "emblem", "subtitle", "attributes", "summary"];
754+ for (var key in keys) {
755+ key = keys[key];
756+ try {
757+ if (typeof components[key] === "string"
758+ || typeof components[key]["field"] === "string") titleAlignment = "Text.AlignLeft";
759+ } catch (e) {
760+ continue;
761+ }
762+ }
763+
749 // code for different elements
764 // code for different elements
750 var titleLabelVisibleExtra = (headerAsOverlay ? '&& overlayLoader.active': '');
765 var titleLabelVisibleExtra = (headerAsOverlay ? '&& overlayLoader.active': '');
751− var titleCode = kTitleLabelCode.arg(titleAnchors).arg(titleColor).arg(titleLabelVisibleExtra).arg(titleWidth);
766+ var titleCode = kTitleLabelCode.arg(titleAnchors).arg(titleColor).arg(titleLabelVisibleExtra).arg(titleWidth).arg(titleAlignment);
752 var subtitleCode;
767 var subtitleCode;
753 var attributesCode;
768 var attributesCode;
754
769
qml/Dash/CardCarousel.qml−1
@@ -66,7 +66,6 @@ DashRenderer {
66 item.cardData = Qt.binding(function() { return model; });
66 item.cardData = Qt.binding(function() { return model; });
67 item.fontScale = Qt.binding(function() { return carousel.fontScale; });
67 item.fontScale = Qt.binding(function() { return carousel.fontScale; });
68 item.showHeader = Qt.binding(function() { return loader.explicitlyScaled; });
68 item.showHeader = Qt.binding(function() { return loader.explicitlyScaled; });
69− item.titleAlignment = Qt.binding(function() { return cardTool.titleAlignment; });
70 item.artShapeStyle = "shadow";
69 item.artShapeStyle = "shadow";
71 item.scopeStyle = cardCarousel.scopeStyle;
70 item.scopeStyle = cardCarousel.scopeStyle;
72 }
71 }
qml/Dash/CardGrid.qml−1
@@ -70,7 +70,6 @@ DashRenderer {
70 item.fixedHeaderHeight = Qt.binding(function() { return cardTool.headerHeight; });
70 item.fixedHeaderHeight = Qt.binding(function() { return cardTool.headerHeight; });
71 item.fixedArtShapeSize = Qt.binding(function() { return cardTool.artShapeSize; });
71 item.fixedArtShapeSize = Qt.binding(function() { return cardTool.artShapeSize; });
72 item.cardData = Qt.binding(function() { return model; });
72 item.cardData = Qt.binding(function() { return model; });
73− item.titleAlignment = Qt.binding(function() { return cardTool.titleAlignment; });
74 item.scopeStyle = root.scopeStyle;
73 item.scopeStyle = root.scopeStyle;
75 item.artShapeStyle = root.artShapeStyle;
74 item.artShapeStyle = root.artShapeStyle;
76 item.backgroundShapeStyle = root.backgroundShapeStyle;
75 item.backgroundShapeStyle = root.backgroundShapeStyle;
qml/Dash/CardHorizontalList.qml−1
@@ -53,7 +53,6 @@ DashRenderer {
53 item.fixedArtShapeSize = Qt.binding(function() { return cardTool.artShapeSize; });
53 item.fixedArtShapeSize = Qt.binding(function() { return cardTool.artShapeSize; });
54 item.fixedHeaderHeight = Qt.binding(function() { return cardTool.headerHeight; });
54 item.fixedHeaderHeight = Qt.binding(function() { return cardTool.headerHeight; });
55 item.cardData = Qt.binding(function() { return model; });
55 item.cardData = Qt.binding(function() { return model; });
56− item.titleAlignment = Qt.binding(function() { return cardTool.titleAlignment; });
57 item.scopeStyle = root.scopeStyle;
56 item.scopeStyle = root.scopeStyle;
58 }
57 }
59 Connections {
58 Connections {
qml/Dash/CardTool.qml−23
@@ -139,29 +139,6 @@ Item {
139 readonly property int headerHeight: cardLoader.item ? cardLoader.item.headerHeight : 0
139 readonly property int headerHeight: cardLoader.item ? cardLoader.item.headerHeight : 0
140 property size artShapeSize: cardLoader.item ? cardLoader.item.artShapeSize : 0
140 property size artShapeSize: cardLoader.item ? cardLoader.item.artShapeSize : 0
141
141
142− /*!
143− \brief Desired alignment of title
144− */
145− readonly property int titleAlignment: {
146− if (template["card-layout"] === "horizontal"
147− || typeof components["title"] !== "object"
148− || components["title"]["align"] === "left") return Text.AlignLeft;
149−
150− var keys = ["mascot", "emblem", "subtitle", "attributes", "summary"];
151−
152− for (var key in keys) {
153− key = keys[key];
154− try {
155− if (typeof components[key] === "string"
156− || typeof components[key]["field"] === "string") return Text.AlignLeft;
157− } catch (e) {
158− continue;
159− }
160− }
161−
162− return Text.AlignHCenter;
163− }
164−
165 QtObject {
142 QtObject {
166 id: carouselTool
143 id: carouselTool
167
144
qml/Dash/CardVerticalJournal.qml−1
@@ -72,7 +72,6 @@ DashRenderer {
72 item.fixedArtShapeSize = Qt.binding(function() { return cardTool.artShapeSize; });
72 item.fixedArtShapeSize = Qt.binding(function() { return cardTool.artShapeSize; });
73 item.fixedHeaderHeight = Qt.binding(function() { return cardTool.headerHeight; });
73 item.fixedHeaderHeight = Qt.binding(function() { return cardTool.headerHeight; });
74 item.cardData = Qt.binding(function() { return model; });
74 item.cardData = Qt.binding(function() { return model; });
75− item.titleAlignment = Qt.binding(function() { return cardTool.titleAlignment; });
76 item.scopeStyle = root.scopeStyle;
75 item.scopeStyle = root.scopeStyle;
77 }
76 }
78 Connections {
77 Connections {
tests/plugins/Dash/cardcreator/1.res+1−2
@@ -5,7 +5,6 @@ AbstractButton {
5 property string backgroundShapeStyle: "inset";
5 property string backgroundShapeStyle: "inset";
6 property real fontScale: 1.0;
6 property real fontScale: 1.0;
7 property var scopeStyle: null;
7 property var scopeStyle: null;
8− property int titleAlignment: Text.AlignLeft;
9 property int fixedHeaderHeight: -1;
8 property int fixedHeaderHeight: -1;
10 property size fixedArtShapeSize: Qt.size(-1, -1);
9 property size fixedArtShapeSize: Qt.size(-1, -1);
11 readonly property string title: cardData && cardData["title"] || "";
10 readonly property string title: cardData && cardData["title"] || "";
@@ -107,7 +106,7 @@ Label {
107 width: undefined;
106 width: undefined;
108 text: root.title;
107 text: root.title;
109 font.weight: cardData && cardData["subtitle"] ? Font.DemiBold : Font.Normal;
108 font.weight: cardData && cardData["subtitle"] ? Font.DemiBold : Font.Normal;
110− horizontalAlignment: root.titleAlignment;
109+ horizontalAlignment: Text.AlignHCenter;
111 }
110 }
112UbuntuShape {
111UbuntuShape {
113 id: touchdown;
112 id: touchdown;
tests/plugins/Dash/cardcreator/1.res.cardcreator+1−2
@@ -5,7 +5,6 @@ AbstractButton {
5 property string backgroundShapeStyle: "inset";
5 property string backgroundShapeStyle: "inset";
6 property real fontScale: 1.0;
6 property real fontScale: 1.0;
7 property var scopeStyle: null;
7 property var scopeStyle: null;
8− property int titleAlignment: Text.AlignLeft;
9 property size fixedArtShapeSize: Qt.size(-1, -1);
8 property size fixedArtShapeSize: Qt.size(-1, -1);
10 readonly property string title: cardData && cardData["title"] || "";
9 readonly property string title: cardData && cardData["title"] || "";
11 property bool showHeader: true;
10 property bool showHeader: true;
@@ -106,7 +105,7 @@ Label {
106 width: undefined;
105 width: undefined;
107 text: root.title;
106 text: root.title;
108 font.weight: cardData && cardData["subtitle"] ? Font.DemiBold : Font.Normal;
107 font.weight: cardData && cardData["subtitle"] ? Font.DemiBold : Font.Normal;
109− horizontalAlignment: root.titleAlignment;
108+ horizontalAlignment: Text.AlignHCenter;
110 }
109 }
111UbuntuShape {
110UbuntuShape {
112 id: touchdown;
111 id: touchdown;
tests/plugins/Dash/cardcreator/10.res+1−2
@@ -5,7 +5,6 @@ AbstractButton {
5 property string backgroundShapeStyle: "inset";
5 property string backgroundShapeStyle: "inset";
6 property real fontScale: 1.0;
6 property real fontScale: 1.0;
7 property var scopeStyle: null;
7 property var scopeStyle: null;
8− property int titleAlignment: Text.AlignLeft;
9 property int fixedHeaderHeight: -1;
8 property int fixedHeaderHeight: -1;
10 property size fixedArtShapeSize: Qt.size(-1, -1);
9 property size fixedArtShapeSize: Qt.size(-1, -1);
11 readonly property string title: cardData && cardData["title"] || "";
10 readonly property string title: cardData && cardData["title"] || "";
@@ -102,7 +101,7 @@ left: parent.left;
102 width: undefined;
101 width: undefined;
103 text: root.title;
102 text: root.title;
104 font.weight: cardData && cardData["subtitle"] ? Font.DemiBold : Font.Normal;
103 font.weight: cardData && cardData["subtitle"] ? Font.DemiBold : Font.Normal;
105− horizontalAlignment: root.titleAlignment;
104+ horizontalAlignment: Text.AlignLeft;
106 }
105 }
107,Label {
106,Label {
108 id: subtitleLabel;
107 id: subtitleLabel;
tests/plugins/Dash/cardcreator/10.res.cardcreator+1−2
@@ -5,7 +5,6 @@ AbstractButton {
5 property string backgroundShapeStyle: "inset";
5 property string backgroundShapeStyle: "inset";
6 property real fontScale: 1.0;
6 property real fontScale: 1.0;
7 property var scopeStyle: null;
7 property var scopeStyle: null;
8− property int titleAlignment: Text.AlignLeft;
9 property size fixedArtShapeSize: Qt.size(-1, -1);
8 property size fixedArtShapeSize: Qt.size(-1, -1);
10 readonly property string title: cardData && cardData["title"] || "";
9 readonly property string title: cardData && cardData["title"] || "";
11 property bool showHeader: true;
10 property bool showHeader: true;
@@ -100,7 +99,7 @@ left: parent.left;
100 width: undefined;
99 width: undefined;
101 text: root.title;
100 text: root.title;
102 font.weight: cardData && cardData["subtitle"] ? Font.DemiBold : Font.Normal;
101 font.weight: cardData && cardData["subtitle"] ? Font.DemiBold : Font.Normal;
103− horizontalAlignment: root.titleAlignment;
102+ horizontalAlignment: Text.AlignLeft;
104 }
103 }
105,Label {
104,Label {
106 id: subtitleLabel;
105 id: subtitleLabel;
tests/plugins/Dash/cardcreator/11.res+1−2
@@ -5,7 +5,6 @@ AbstractButton {
5 property string backgroundShapeStyle: "inset";
5 property string backgroundShapeStyle: "inset";
6 property real fontScale: 1.0;
6 property real fontScale: 1.0;
7 property var scopeStyle: null;
7 property var scopeStyle: null;
8− property int titleAlignment: Text.AlignLeft;
9 property int fixedHeaderHeight: -1;
8 property int fixedHeaderHeight: -1;
10 property size fixedArtShapeSize: Qt.size(-1, -1);
9 property size fixedArtShapeSize: Qt.size(-1, -1);
11 readonly property string title: cardData && cardData["title"] || "";
10 readonly property string title: cardData && cardData["title"] || "";
@@ -177,7 +176,7 @@ left: parent.left;
177 width: undefined;
176 width: undefined;
178 text: root.title;
177 text: root.title;
179 font.weight: cardData && cardData["subtitle"] ? Font.DemiBold : Font.Normal;
178 font.weight: cardData && cardData["subtitle"] ? Font.DemiBold : Font.Normal;
180− horizontalAlignment: root.titleAlignment;
179+ horizontalAlignment: Text.AlignLeft;
181 }
180 }
182,Label {
181,Label {
183 id: subtitleLabel;
182 id: subtitleLabel;
tests/plugins/Dash/cardcreator/11.res.cardcreator+1−2
@@ -5,7 +5,6 @@ AbstractButton {
5 property string backgroundShapeStyle: "inset";
5 property string backgroundShapeStyle: "inset";
6 property real fontScale: 1.0;
6 property real fontScale: 1.0;
7 property var scopeStyle: null;
7 property var scopeStyle: null;
8− property int titleAlignment: Text.AlignLeft;
9 property size fixedArtShapeSize: Qt.size(-1, -1);
8 property size fixedArtShapeSize: Qt.size(-1, -1);
10 readonly property string title: cardData && cardData["title"] || "";
9 readonly property string title: cardData && cardData["title"] || "";
11 property bool showHeader: true;
10 property bool showHeader: true;
@@ -173,7 +172,7 @@ left: parent.left;
173 width: undefined;
172 width: undefined;
174 text: root.title;
173 text: root.title;
175 font.weight: cardData && cardData["subtitle"] ? Font.DemiBold : Font.Normal;
174 font.weight: cardData && cardData["subtitle"] ? Font.DemiBold : Font.Normal;
176− horizontalAlignment: root.titleAlignment;
175+ horizontalAlignment: Text.AlignLeft;
177 }
176 }
178,Label {
177,Label {
179 id: subtitleLabel;
178 id: subtitleLabel;
tests/plugins/Dash/cardcreator/2.res+1−2
@@ -5,7 +5,6 @@ AbstractButton {
5 property string backgroundShapeStyle: "inset";
5 property string backgroundShapeStyle: "inset";
6 property real fontScale: 1.0;
6 property real fontScale: 1.0;
7 property var scopeStyle: null;
7 property var scopeStyle: null;
8− property int titleAlignment: Text.AlignLeft;
9 property int fixedHeaderHeight: -1;
8 property int fixedHeaderHeight: -1;
10 property size fixedArtShapeSize: Qt.size(-1, -1);
9 property size fixedArtShapeSize: Qt.size(-1, -1);
11 readonly property string title: cardData && cardData["title"] || "";
10 readonly property string title: cardData && cardData["title"] || "";
@@ -101,7 +100,7 @@ CroppedImageMinimumSourceSize {
101 width: undefined;
100 width: undefined;
102 text: root.title;
101 text: root.title;
103 font.weight: cardData && cardData["subtitle"] ? Font.DemiBold : Font.Normal;
102 font.weight: cardData && cardData["subtitle"] ? Font.DemiBold : Font.Normal;
104− horizontalAlignment: root.titleAlignment;
103+ horizontalAlignment: Text.AlignLeft;
105 }
104 }
106 ,Label {
105 ,Label {
107 id: subtitleLabel;
106 id: subtitleLabel;
tests/plugins/Dash/cardcreator/2.res.cardcreator+1−2
@@ -5,7 +5,6 @@ AbstractButton {
5 property string backgroundShapeStyle: "inset";
5 property string backgroundShapeStyle: "inset";
6 property real fontScale: 1.0;
6 property real fontScale: 1.0;
7 property var scopeStyle: null;
7 property var scopeStyle: null;
8− property int titleAlignment: Text.AlignLeft;
9 property size fixedArtShapeSize: Qt.size(-1, -1);
8 property size fixedArtShapeSize: Qt.size(-1, -1);
10 readonly property string title: cardData && cardData["title"] || "";
9 readonly property string title: cardData && cardData["title"] || "";
11 property bool showHeader: true;
10 property bool showHeader: true;
@@ -99,7 +98,7 @@ CroppedImageMinimumSourceSize {
99 width: undefined;
98 width: undefined;
100 text: root.title;
99 text: root.title;
101 font.weight: cardData && cardData["subtitle"] ? Font.DemiBold : Font.Normal;
100 font.weight: cardData && cardData["subtitle"] ? Font.DemiBold : Font.Normal;
102− horizontalAlignment: root.titleAlignment;
101+ horizontalAlignment: Text.AlignLeft;
103 }
102 }
104 ,Label {
103 ,Label {
105 id: subtitleLabel;
104 id: subtitleLabel;
tests/plugins/Dash/cardcreator/3.res+1−2
@@ -5,7 +5,6 @@ AbstractButton {
5 property string backgroundShapeStyle: "inset";
5 property string backgroundShapeStyle: "inset";
6 property real fontScale: 1.0;
6 property real fontScale: 1.0;
7 property var scopeStyle: null;
7 property var scopeStyle: null;
8− property int titleAlignment: Text.AlignLeft;
9 property int fixedHeaderHeight: -1;
8 property int fixedHeaderHeight: -1;
10 property size fixedArtShapeSize: Qt.size(-1, -1);
9 property size fixedArtShapeSize: Qt.size(-1, -1);
11 readonly property string title: cardData && cardData["title"] || "";
10 readonly property string title: cardData && cardData["title"] || "";
@@ -108,7 +107,7 @@ Label {
108 width: undefined;
107 width: undefined;
109 text: root.title;
108 text: root.title;
110 font.weight: cardData && cardData["subtitle"] ? Font.DemiBold : Font.Normal;
109 font.weight: cardData && cardData["subtitle"] ? Font.DemiBold : Font.Normal;
111− horizontalAlignment: root.titleAlignment;
110+ horizontalAlignment: Text.AlignLeft;
112 }
111 }
113Label {
112Label {
114 id: subtitleLabel;
113 id: subtitleLabel;
tests/plugins/Dash/cardcreator/3.res.cardcreator+1−2
@@ -5,7 +5,6 @@ AbstractButton {
5 property string backgroundShapeStyle: "inset";
5 property string backgroundShapeStyle: "inset";
6 property real fontScale: 1.0;
6 property real fontScale: 1.0;
7 property var scopeStyle: null;
7 property var scopeStyle: null;
8− property int titleAlignment: Text.AlignLeft;
9 property size fixedArtShapeSize: Qt.size(-1, -1);
8 property size fixedArtShapeSize: Qt.size(-1, -1);
10 readonly property string title: cardData && cardData["title"] || "";
9 readonly property string title: cardData && cardData["title"] || "";
11 property bool showHeader: true;
10 property bool showHeader: true;
@@ -106,7 +105,7 @@ Label {
106 width: undefined;
105 width: undefined;
107 text: root.title;
106 text: root.title;
108 font.weight: cardData && cardData["subtitle"] ? Font.DemiBold : Font.Normal;
107 font.weight: cardData && cardData["subtitle"] ? Font.DemiBold : Font.Normal;
109− horizontalAlignment: root.titleAlignment;
108+ horizontalAlignment: Text.AlignLeft;
110 }
109 }
111Label {
110Label {
112 id: subtitleLabel;
111 id: subtitleLabel;
tests/plugins/Dash/cardcreator/4.res+1−2
@@ -5,7 +5,6 @@ AbstractButton {
5 property string backgroundShapeStyle: "inset";
5 property string backgroundShapeStyle: "inset";
6 property real fontScale: 1.0;
6 property real fontScale: 1.0;
7 property var scopeStyle: null;
7 property var scopeStyle: null;
8− property int titleAlignment: Text.AlignLeft;
9 property int fixedHeaderHeight: -1;
8 property int fixedHeaderHeight: -1;
10 property size fixedArtShapeSize: Qt.size(-1, -1);
9 property size fixedArtShapeSize: Qt.size(-1, -1);
11 readonly property string title: cardData && cardData["title"] || "";
10 readonly property string title: cardData && cardData["title"] || "";
@@ -76,7 +75,7 @@ Label {
76 width: undefined;
75 width: undefined;
77 text: root.title;
76 text: root.title;
78 font.weight: cardData && cardData["subtitle"] ? Font.DemiBold : Font.Normal;
77 font.weight: cardData && cardData["subtitle"] ? Font.DemiBold : Font.Normal;
79− horizontalAlignment: root.titleAlignment;
78+ horizontalAlignment: Text.AlignLeft;
80 }
79 }
81,Label {
80,Label {
82 id: subtitleLabel;
81 id: subtitleLabel;
tests/plugins/Dash/cardcreator/4.res.cardcreator+1−2
@@ -5,7 +5,6 @@ AbstractButton {
5 property string backgroundShapeStyle: "inset";
5 property string backgroundShapeStyle: "inset";
6 property real fontScale: 1.0;
6 property real fontScale: 1.0;
7 property var scopeStyle: null;
7 property var scopeStyle: null;
8− property int titleAlignment: Text.AlignLeft;
9 property size fixedArtShapeSize: Qt.size(-1, -1);
8 property size fixedArtShapeSize: Qt.size(-1, -1);
10 readonly property string title: cardData && cardData["title"] || "";
9 readonly property string title: cardData && cardData["title"] || "";
11 property bool showHeader: true;
10 property bool showHeader: true;
@@ -74,7 +73,7 @@ Label {
74 width: undefined;
73 width: undefined;
75 text: root.title;
74 text: root.title;
76 font.weight: cardData && cardData["subtitle"] ? Font.DemiBold : Font.Normal;
75 font.weight: cardData && cardData["subtitle"] ? Font.DemiBold : Font.Normal;
77− horizontalAlignment: root.titleAlignment;
76+ horizontalAlignment: Text.AlignLeft;
78 }
77 }
79,Label {
78,Label {
80 id: subtitleLabel;
79 id: subtitleLabel;
tests/plugins/Dash/cardcreator/5.res+1−2
@@ -5,7 +5,6 @@ AbstractButton {
5 property string backgroundShapeStyle: "inset";
5 property string backgroundShapeStyle: "inset";
6 property real fontScale: 1.0;
6 property real fontScale: 1.0;
7 property var scopeStyle: null;
7 property var scopeStyle: null;
8− property int titleAlignment: Text.AlignLeft;
9 property int fixedHeaderHeight: -1;
8 property int fixedHeaderHeight: -1;
10 property size fixedArtShapeSize: Qt.size(-1, -1);
9 property size fixedArtShapeSize: Qt.size(-1, -1);
11 readonly property string title: cardData && cardData["title"] || "";
10 readonly property string title: cardData && cardData["title"] || "";
@@ -125,7 +124,7 @@ Label {
125 width: undefined;
124 width: undefined;
126 text: root.title;
125 text: root.title;
127 font.weight: cardData && cardData["subtitle"] ? Font.DemiBold : Font.Normal;
126 font.weight: cardData && cardData["subtitle"] ? Font.DemiBold : Font.Normal;
128− horizontalAlignment: root.titleAlignment;
127+ horizontalAlignment: Text.AlignLeft;
129 }
128 }
130Label {
129Label {
131 id: subtitleLabel;
130 id: subtitleLabel;
tests/plugins/Dash/cardcreator/5.res.cardcreator+1−2
@@ -5,7 +5,6 @@ AbstractButton {
5 property string backgroundShapeStyle: "inset";
5 property string backgroundShapeStyle: "inset";
6 property real fontScale: 1.0;
6 property real fontScale: 1.0;
7 property var scopeStyle: null;
7 property var scopeStyle: null;
8− property int titleAlignment: Text.AlignLeft;
9 property size fixedArtShapeSize: Qt.size(-1, -1);
8 property size fixedArtShapeSize: Qt.size(-1, -1);
10 readonly property string title: cardData && cardData["title"] || "";
9 readonly property string title: cardData && cardData["title"] || "";
11 property bool showHeader: true;
10 property bool showHeader: true;
@@ -124,7 +123,7 @@ Label {
124 width: undefined;
123 width: undefined;
125 text: root.title;
124 text: root.title;
126 font.weight: cardData && cardData["subtitle"] ? Font.DemiBold : Font.Normal;
125 font.weight: cardData && cardData["subtitle"] ? Font.DemiBold : Font.Normal;
127− horizontalAlignment: root.titleAlignment;
126+ horizontalAlignment: Text.AlignLeft;
128 }
127 }
129Label {
128Label {
130 id: subtitleLabel;
129 id: subtitleLabel;
tests/plugins/Dash/cardcreator/6.res+1−2
@@ -5,7 +5,6 @@ AbstractButton {
5 property string backgroundShapeStyle: "inset";
5 property string backgroundShapeStyle: "inset";
6 property real fontScale: 1.0;
6 property real fontScale: 1.0;
7 property var scopeStyle: null;
7 property var scopeStyle: null;
8− property int titleAlignment: Text.AlignLeft;
9 property int fixedHeaderHeight: -1;
8 property int fixedHeaderHeight: -1;
10 property size fixedArtShapeSize: Qt.size(-1, -1);
9 property size fixedArtShapeSize: Qt.size(-1, -1);
11 readonly property string title: cardData && cardData["title"] || "";
10 readonly property string title: cardData && cardData["title"] || "";
@@ -80,7 +79,7 @@ Item {
80 width: undefined;
79 width: undefined;
81 text: root.title;
80 text: root.title;
82 font.weight: cardData && cardData["subtitle"] ? Font.DemiBold : Font.Normal;
81 font.weight: cardData && cardData["subtitle"] ? Font.DemiBold : Font.Normal;
83− horizontalAlignment: root.titleAlignment;
82+ horizontalAlignment: Text.AlignLeft;
84 }
83 }
85,Label {
84,Label {
86 id: subtitleLabel;
85 id: subtitleLabel;
tests/plugins/Dash/cardcreator/6.res.cardcreator+1−2
@@ -5,7 +5,6 @@ AbstractButton {
5 property string backgroundShapeStyle: "inset";
5 property string backgroundShapeStyle: "inset";
6 property real fontScale: 1.0;
6 property real fontScale: 1.0;
7 property var scopeStyle: null;
7 property var scopeStyle: null;
8− property int titleAlignment: Text.AlignLeft;
9 property size fixedArtShapeSize: Qt.size(-1, -1);
8 property size fixedArtShapeSize: Qt.size(-1, -1);
10 readonly property string title: cardData && cardData["title"] || "";
9 readonly property string title: cardData && cardData["title"] || "";
11 property bool showHeader: true;
10 property bool showHeader: true;
@@ -79,7 +78,7 @@ Item {
79 width: undefined;
78 width: undefined;
80 text: root.title;
79 text: root.title;
81 font.weight: cardData && cardData["subtitle"] ? Font.DemiBold : Font.Normal;
80 font.weight: cardData && cardData["subtitle"] ? Font.DemiBold : Font.Normal;
82− horizontalAlignment: root.titleAlignment;
81+ horizontalAlignment: Text.AlignLeft;
83 }
82 }
84,Label {
83,Label {
85 id: subtitleLabel;
84 id: subtitleLabel;
tests/plugins/Dash/cardcreator/7.res+1−2
@@ -5,7 +5,6 @@ AbstractButton {
5 property string backgroundShapeStyle: "inset";
5 property string backgroundShapeStyle: "inset";
6 property real fontScale: 1.0;
6 property real fontScale: 1.0;
7 property var scopeStyle: null;
7 property var scopeStyle: null;
8− property int titleAlignment: Text.AlignLeft;
9 property int fixedHeaderHeight: -1;
8 property int fixedHeaderHeight: -1;
10 property size fixedArtShapeSize: Qt.size(-1, -1);
9 property size fixedArtShapeSize: Qt.size(-1, -1);
11 readonly property string title: cardData && cardData["title"] || "";
10 readonly property string title: cardData && cardData["title"] || "";
@@ -102,7 +101,7 @@ CroppedImageMinimumSourceSize {
102 width: undefined;
101 width: undefined;
103 text: root.title;
102 text: root.title;
104 font.weight: cardData && cardData["subtitle"] ? Font.DemiBold : Font.Normal;
103 font.weight: cardData && cardData["subtitle"] ? Font.DemiBold : Font.Normal;
105− horizontalAlignment: root.titleAlignment;
104+ horizontalAlignment: Text.AlignLeft;
106 }
105 }
107,Label {
106,Label {
108 id: subtitleLabel;
107 id: subtitleLabel;
tests/plugins/Dash/cardcreator/7.res.cardcreator+1−2
@@ -5,7 +5,6 @@ AbstractButton {
5 property string backgroundShapeStyle: "inset";
5 property string backgroundShapeStyle: "inset";
6 property real fontScale: 1.0;
6 property real fontScale: 1.0;
7 property var scopeStyle: null;
7 property var scopeStyle: null;
8− property int titleAlignment: Text.AlignLeft;
9 property size fixedArtShapeSize: Qt.size(-1, -1);
8 property size fixedArtShapeSize: Qt.size(-1, -1);
10 readonly property string title: cardData && cardData["title"] || "";
9 readonly property string title: cardData && cardData["title"] || "";
11 property bool showHeader: true;
10 property bool showHeader: true;
@@ -100,7 +99,7 @@ CroppedImageMinimumSourceSize {
100 width: undefined;
99 width: undefined;
101 text: root.title;
100 text: root.title;
102 font.weight: cardData && cardData["subtitle"] ? Font.DemiBold : Font.Normal;
101 font.weight: cardData && cardData["subtitle"] ? Font.DemiBold : Font.Normal;
103− horizontalAlignment: root.titleAlignment;
102+ horizontalAlignment: Text.AlignLeft;
104 }
103 }
105,Label {
104,Label {
106 id: subtitleLabel;
105 id: subtitleLabel;
tests/plugins/Dash/cardcreator/8.res+1−2
@@ -5,7 +5,6 @@ AbstractButton {
5 property string backgroundShapeStyle: "inset";
5 property string backgroundShapeStyle: "inset";
6 property real fontScale: 1.0;
6 property real fontScale: 1.0;
7 property var scopeStyle: null;
7 property var scopeStyle: null;
8− property int titleAlignment: Text.AlignLeft;
9 property int fixedHeaderHeight: -1;
8 property int fixedHeaderHeight: -1;
10 property size fixedArtShapeSize: Qt.size(-1, -1);
9 property size fixedArtShapeSize: Qt.size(-1, -1);
11 readonly property string title: cardData && cardData["title"] || "";
10 readonly property string title: cardData && cardData["title"] || "";
@@ -93,7 +92,7 @@ left: parent.left;
93 width: parent.width - x;
92 width: parent.width - x;
94 text: root.title;
93 text: root.title;
95 font.weight: cardData && cardData["subtitle"] ? Font.DemiBold : Font.Normal;
94 font.weight: cardData && cardData["subtitle"] ? Font.DemiBold : Font.Normal;
96− horizontalAlignment: root.titleAlignment;
95+ horizontalAlignment: Text.AlignLeft;
97 }
96 }
98
97
99 ]
98 ]
tests/plugins/Dash/cardcreator/8.res.cardcreator+1−2
@@ -5,7 +5,6 @@ AbstractButton {
5 property string backgroundShapeStyle: "inset";
5 property string backgroundShapeStyle: "inset";
6 property real fontScale: 1.0;
6 property real fontScale: 1.0;
7 property var scopeStyle: null;
7 property var scopeStyle: null;
8− property int titleAlignment: Text.AlignLeft;
9 property size fixedArtShapeSize: Qt.size(-1, -1);
8 property size fixedArtShapeSize: Qt.size(-1, -1);
10 readonly property string title: cardData && cardData["title"] || "";
9 readonly property string title: cardData && cardData["title"] || "";
11 property bool showHeader: true;
10 property bool showHeader: true;
@@ -91,7 +90,7 @@ left: parent.left;
91 width: parent.width - x;
90 width: parent.width - x;
92 text: root.title;
91 text: root.title;
93 font.weight: cardData && cardData["subtitle"] ? Font.DemiBold : Font.Normal;
92 font.weight: cardData && cardData["subtitle"] ? Font.DemiBold : Font.Normal;
94− horizontalAlignment: root.titleAlignment;
93+ horizontalAlignment: Text.AlignLeft;
95 }
94 }
96
95
97 ]
96 ]
tests/plugins/Dash/cardcreator/9.res+1−2
@@ -5,7 +5,6 @@ AbstractButton {
5 property string backgroundShapeStyle: "inset";
5 property string backgroundShapeStyle: "inset";
6 property real fontScale: 1.0;
6 property real fontScale: 1.0;
7 property var scopeStyle: null;
7 property var scopeStyle: null;
8− property int titleAlignment: Text.AlignLeft;
9 property int fixedHeaderHeight: -1;
8 property int fixedHeaderHeight: -1;
10 property size fixedArtShapeSize: Qt.size(-1, -1);
9 property size fixedArtShapeSize: Qt.size(-1, -1);
11 readonly property string title: cardData && cardData["title"] || "";
10 readonly property string title: cardData && cardData["title"] || "";
@@ -35,7 +34,7 @@ top: parent.top;
35 width: undefined;
34 width: undefined;
36 text: root.title;
35 text: root.title;
37 font.weight: cardData && cardData["subtitle"] ? Font.DemiBold : Font.Normal;
36 font.weight: cardData && cardData["subtitle"] ? Font.DemiBold : Font.Normal;
38− horizontalAlignment: root.titleAlignment;
37+ horizontalAlignment: Text.AlignLeft;
39 }
38 }
40Label {
39Label {
41 id: subtitleLabel;
40 id: subtitleLabel;
tests/plugins/Dash/cardcreator/9.res.cardcreator+1−2
@@ -5,7 +5,6 @@ AbstractButton {
5 property string backgroundShapeStyle: "inset";
5 property string backgroundShapeStyle: "inset";
6 property real fontScale: 1.0;
6 property real fontScale: 1.0;
7 property var scopeStyle: null;
7 property var scopeStyle: null;
8− property int titleAlignment: Text.AlignLeft;
9 property size fixedArtShapeSize: Qt.size(-1, -1);
8 property size fixedArtShapeSize: Qt.size(-1, -1);
10 readonly property string title: cardData && cardData["title"] || "";
9 readonly property string title: cardData && cardData["title"] || "";
11 property bool showHeader: true;
10 property bool showHeader: true;
@@ -34,7 +33,7 @@ top: parent.top;
34 width: undefined;
33 width: undefined;
35 text: root.title;
34 text: root.title;
36 font.weight: cardData && cardData["subtitle"] ? Font.DemiBold : Font.Normal;
35 font.weight: cardData && cardData["subtitle"] ? Font.DemiBold : Font.Normal;
37− horizontalAlignment: root.titleAlignment;
36+ horizontalAlignment: Text.AlignLeft;
38 }
37 }
39Label {
38Label {
40 id: subtitleLabel;
39 id: subtitleLabel;
tests/qmltests/Dash/tst_CardTool.qml+4−4
@@ -339,22 +339,22 @@ Rectangle {
339 function test_card_title_alignment(data) {
339 function test_card_title_alignment(data) {
340 selector.selectedIndex = data.index;
340 selector.selectedIndex = data.index;
341
341
342− tryCompare(cardTool, "titleAlignment", Text.AlignLeft);
342+ tryCompareFunction(function() { return findChild(internalCard, "titleLabel").horizontalAlignment == Text.AlignLeft; }, true);
343
343
344 cardTool.components['title'] = { "field": "title", "align": "center" };
344 cardTool.components['title'] = { "field": "title", "align": "center" };
345 cardTool.componentsChanged();
345 cardTool.componentsChanged();
346
346
347− tryCompare(cardTool, "titleAlignment", data.value);
347+ tryCompareFunction(function() { return findChild(internalCard, "titleLabel").horizontalAlignment == data.value; }, true);
348
348
349 cardTool.components['title'] = { "field": "title" };
349 cardTool.components['title'] = { "field": "title" };
350 cardTool.componentsChanged();
350 cardTool.componentsChanged();
351
351
352− tryCompare(cardTool, "titleAlignment", data.value);
352+ tryCompareFunction(function() { return findChild(internalCard, "titleLabel").horizontalAlignment == data.value; }, true);
353
353
354 cardTool.components['title'] = { "field": "title", "align": "left" };
354 cardTool.components['title'] = { "field": "title", "align": "left" };
355 cardTool.componentsChanged();
355 cardTool.componentsChanged();
356
356
357− tryCompare(cardTool, "titleAlignment", Text.AlignLeft);
357+ tryCompareFunction(function() { return findChild(internalCard, "titleLabel").horizontalAlignment == Text.AlignLeft; }, true);
358 }
358 }
359
359
360 function test_categoryLayout_data() {
360 function test_categoryLayout_data() {