Changeset View
Changeset View
Standalone View
Standalone View
discover/qml/ApplicationPage.qml
Show First 20 Lines • Show All 142 Lines • ▼ Show 20 Line(s) | 140 | Button { | |||
---|---|---|---|---|---|
143 | text: i18n("Launch") | 143 | text: i18n("Launch") | ||
144 | onClicked: application.invokeApplication() | 144 | onClicked: application.invokeApplication() | ||
145 | } | 145 | } | ||
146 | } | 146 | } | ||
147 | } | 147 | } | ||
148 | 148 | | |||
149 | ColumnLayout { | 149 | ColumnLayout { | ||
150 | spacing: 0 | 150 | spacing: 0 | ||
151 | | ||||
152 | QQC2.Label { | 151 | QQC2.Label { | ||
153 | Layout.fillWidth: true | 152 | Layout.fillWidth: true | ||
153 | Text { | ||||
154 | text: appInfo.application.comment | 154 | text: appInfo.application.comment | ||
155 | font.bold: true | ||||
156 | } | ||||
alexeymin: Why do you put a `Text` inside a label? Why not use `font.bold` property of Label itself? | |||||
This was actually the only way I could get it to work. Doing this: QQC2.Label { Layout.fillWidth: true text: appInfo.application.comment font.bold: true wrapMode: Text.WordWrap elide: Text.ElideRight maximumLineCount: 1 bottomPadding: 20 } ...had no effect, and did not make the text bold. ngraham: This was actually the only way I could get it to work. Doing this:
```
QQC2.Label {… | |||||
155 | wrapMode: Text.WordWrap | 157 | wrapMode: Text.WordWrap | ||
156 | elide: Text.ElideRight | 158 | elide: Text.ElideRight | ||
157 | maximumLineCount: 1 | 159 | maximumLineCount: 1 | ||
160 | bottomPadding: 20 | ||||
161 | } | ||||
162 | | ||||
163 | GridLayout { | ||||
Does Layout.fillWidth have an effect here? Shouldn't it be inside of QQC2.Label block? alexeymin: Does `Layout.fillWidth` have an effect here? Shouldn't it be inside of QQC2.Label block? | |||||
164 | rowSpacing: 0 | ||||
165 | columns: 2 | ||||
166 | | ||||
167 | // Category row | ||||
168 | QQC2.Label { | ||||
169 | Layout.alignment: Qt.AlignRight | ||||
170 | text: i18n("Category:") | ||||
158 | } | 171 | } | ||
159 | QQC2.Label { | 172 | QQC2.Label { | ||
160 | Layout.fillWidth: true | 173 | Layout.fillWidth: true | ||
161 | elide: Text.ElideRight | 174 | elide: Text.ElideRight | ||
162 | text: appInfo.application.categoryDisplay | 175 | text: appInfo.application.categoryDisplay | ||
163 | color: Kirigami.Theme.linkColor | | |||
164 | } | 176 | } | ||
165 | 177 | | |||
166 | Item { | 178 | // Version row | ||
167 | Layout.fillWidth: true | | |||
168 | Layout.fillHeight: true | | |||
169 | } | | |||
170 | QQC2.Label { | 179 | QQC2.Label { | ||
171 | Layout.fillWidth: true | | |||
172 | elide: Text.ElideRight | | |||
173 | readonly property string version: appInfo.application.isInstalled ? appInfo.application.installedVersion : appInfo.application.availableVersion | 180 | readonly property string version: appInfo.application.isInstalled ? appInfo.application.installedVersion : appInfo.application.availableVersion | ||
174 | visible: version.length > 0 | 181 | visible: version.length > 0 | ||
175 | text: version ? i18n("Version: %1", version) : "" | 182 | Layout.alignment: Qt.AlignRight | ||
183 | text: i18n("Version:") | ||||
176 | } | 184 | } | ||
alexeymin: Translation is probably not needed here now | |||||
177 | QQC2.Label { | 185 | QQC2.Label { | ||
186 | readonly property string version: appInfo.application.isInstalled ? appInfo.application.installedVersion : appInfo.application.availableVersion | ||||
187 | visible: version.length > 0 | ||||
178 | Layout.fillWidth: true | 188 | Layout.fillWidth: true | ||
179 | elide: Text.ElideRight | 189 | elide: Text.ElideRight | ||
180 | text: i18n("Size: %1", appInfo.application.sizeDescription) | 190 | text: version ? version : "" | ||
181 | } | 191 | } | ||
182 | RowLayout { | 192 | | ||
193 | // Size row | ||||
194 | QQC2.Label { | ||||
195 | Layout.alignment: Qt.AlignRight | ||||
196 | text: i18n("Size:") | ||||
197 | } | ||||
198 | QQC2.Label { | ||||
183 | Layout.fillWidth: true | 199 | Layout.fillWidth: true | ||
200 | elide: Text.ElideRight | ||||
201 | text: i18n("%1", appInfo.application.sizeDescription) | ||||
202 | } | ||||
203 | | ||||
204 | // Source row | ||||
184 | QQC2.Label { | 205 | QQC2.Label { | ||
206 | Layout.alignment: Qt.AlignRight | ||||
185 | text: i18n("Source:") | 207 | text: i18n("Source:") | ||
186 | } | 208 | } | ||
187 | LinkButton { | 209 | LinkButton { | ||
188 | Layout.fillWidth: true | 210 | Layout.fillWidth: true | ||
189 | horizontalAlignment: Text.AlignLeft | 211 | horizontalAlignment: Text.AlignLeft | ||
190 | enabled: alternativeResourcesView.count > 1 | 212 | enabled: alternativeResourcesView.count > 1 | ||
191 | text: appInfo.application.displayOrigin | 213 | text: appInfo.application.displayOrigin | ||
214 | elide: Text.ElideRight | ||||
192 | onClicked: originsOverlay.open() | 215 | onClicked: originsOverlay.open() | ||
193 | } | 216 | } | ||
194 | } | 217 | | ||
195 | RowLayout { | 218 | // License row | ||
196 | QQC2.Label { | 219 | QQC2.Label { | ||
220 | Layout.alignment: Qt.AlignRight | ||||
197 | text: i18n("License:") | 221 | text: i18n("License:") | ||
198 | } | 222 | } | ||
199 | LinkButton { | 223 | LinkButton { | ||
224 | elide: Text.ElideRight | ||||
200 | Layout.fillWidth: true | 225 | Layout.fillWidth: true | ||
201 | horizontalAlignment: Text.AlignLeft | 226 | horizontalAlignment: Text.AlignLeft | ||
202 | text: appInfo.application.license | 227 | text: appInfo.application.license | ||
203 | // tooltip: i18n("See full license terms") | 228 | // tooltip: i18n("See full license terms") | ||
204 | onClicked: Qt.openUrlExternally("https://spdx.org/licenses/" + appInfo.application.license + ".html#licenseText") | 229 | onClicked: Qt.openUrlExternally("https://spdx.org/licenses/" + appInfo.application.license + ".html#licenseText") | ||
205 | } | 230 | } | ||
206 | } | 231 | } | ||
207 | 232 | | |||
▲ Show 20 Lines • Show All 74 Lines • Show Last 20 Lines |
Why do you put a Text inside a label? Why not use font.bold property of Label itself?