on xenial help sign in
Use aliases for labels instead of defining new properties
1dbd917Michael Terry
Components/DemoOverlay.qml+4−6
@@ -31,17 +31,17 @@ Showable {
31 /*
31 /*
32 * This is the header displayed, like "Right edge".
32 * This is the header displayed, like "Right edge".
33 */
33 */
34− property string title
34+ property alias title: titleLabel.text
35
35
36 /*
36 /*
37 * This is the block of text displayed below the header.
37 * This is the block of text displayed below the header.
38 */
38 */
39− property string text
39+ property alias text: textLabel.text
40
40
41 /*
41 /*
42 * This is the text for the skip button.
42 * This is the text for the skip button.
43 */
43 */
44− property string skipText: i18n.tr("Skip intro")
44+ property alias skipText: skipLabel.text
45
45
46 /*
46 /*
47 * Whether this demo is running currently.
47 * Whether this demo is running currently.
@@ -118,7 +118,6 @@ Showable {
118
118
119 Label {
119 Label {
120 id: titleLabel
120 id: titleLabel
121− text: overlay.title
122 fontSize: "x-large"
121 fontSize: "x-large"
123 width: units.gu(25)
122 width: units.gu(25)
124 wrapMode: Text.WordWrap
123 wrapMode: Text.WordWrap
@@ -126,7 +125,6 @@ Showable {
126
125
127 Label {
126 Label {
128 id: textLabel
127 id: textLabel
129− text: overlay.text
130 width: units.gu(25)
128 width: units.gu(25)
131 wrapMode: Text.WordWrap
129 wrapMode: Text.WordWrap
132 }
130 }
@@ -134,7 +132,7 @@ Showable {
134 Label {
132 Label {
135 id: skipLabel
133 id: skipLabel
136 objectName: "skipLabel"
134 objectName: "skipLabel"
137− text: overlay.skipText
135+ text: i18n.tr("Skip intro")
138 color: overlay.__orange
136 color: overlay.__orange
139 fontSize: "small"
137 fontSize: "small"
140 font.underline: true
138 font.underline: true