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 | 151 | Kirigami.Heading { | |||
152 | QQC2.Label { | | |||
153 | Layout.fillWidth: true | | |||
154 | text: appInfo.application.comment | 152 | text: appInfo.application.comment | ||
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 | 153 | level: 4 | ||
154 | Layout.fillWidth: true | ||||
156 | elide: Text.ElideRight | 155 | elide: Text.ElideRight | ||
157 | maximumLineCount: 1 | 156 | bottomPadding: Kirigami.Units.largeSpacing | ||
157 | } | ||||
158 | | ||||
159 | 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? | |||||
160 | rowSpacing: 0 | ||||
161 | columns: 2 | ||||
162 | | ||||
163 | // Category row | ||||
164 | QQC2.Label { | ||||
165 | Layout.alignment: Qt.AlignRight | ||||
166 | text: i18n("Category:") | ||||
158 | } | 167 | } | ||
159 | QQC2.Label { | 168 | QQC2.Label { | ||
160 | Layout.fillWidth: true | 169 | Layout.fillWidth: true | ||
161 | elide: Text.ElideRight | 170 | elide: Text.ElideRight | ||
162 | text: appInfo.application.categoryDisplay | 171 | text: appInfo.application.categoryDisplay | ||
163 | color: Kirigami.Theme.linkColor | | |||
164 | } | 172 | } | ||
165 | 173 | | |||
166 | Item { | 174 | // Version row | ||
167 | Layout.fillWidth: true | | |||
168 | Layout.fillHeight: true | | |||
169 | } | | |||
170 | QQC2.Label { | 175 | QQC2.Label { | ||
171 | Layout.fillWidth: true | | |||
172 | elide: Text.ElideRight | | |||
173 | readonly property string version: appInfo.application.isInstalled ? appInfo.application.installedVersion : appInfo.application.availableVersion | 176 | readonly property string version: appInfo.application.isInstalled ? appInfo.application.installedVersion : appInfo.application.availableVersion | ||
174 | visible: version.length > 0 | 177 | visible: version.length > 0 | ||
175 | text: version ? i18n("Version: %1", version) : "" | 178 | Layout.alignment: Qt.AlignRight | ||
179 | text: i18n("Version:") | ||||
176 | } | 180 | } | ||
alexeymin: Translation is probably not needed here now | |||||
177 | QQC2.Label { | 181 | QQC2.Label { | ||
182 | readonly property string version: appInfo.application.isInstalled ? appInfo.application.installedVersion : appInfo.application.availableVersion | ||||
183 | visible: version.length > 0 | ||||
178 | Layout.fillWidth: true | 184 | Layout.fillWidth: true | ||
179 | elide: Text.ElideRight | 185 | elide: Text.ElideRight | ||
180 | text: i18n("Size: %1", appInfo.application.sizeDescription) | 186 | text: version ? version : "" | ||
187 | } | ||||
188 | | ||||
189 | // Size row | ||||
190 | QQC2.Label { | ||||
191 | Layout.alignment: Qt.AlignRight | ||||
192 | text: i18n("Size:") | ||||
181 | } | 193 | } | ||
182 | RowLayout { | 194 | QQC2.Label { | ||
183 | Layout.fillWidth: true | 195 | Layout.fillWidth: true | ||
196 | elide: Text.ElideRight | ||||
197 | text: i18n("%1", appInfo.application.sizeDescription) | ||||
198 | } | ||||
199 | | ||||
200 | // Source row | ||||
184 | QQC2.Label { | 201 | QQC2.Label { | ||
202 | Layout.alignment: Qt.AlignRight | ||||
185 | text: i18n("Source:") | 203 | text: i18n("Source:") | ||
186 | } | 204 | } | ||
187 | LinkButton { | 205 | LinkButton { | ||
188 | Layout.fillWidth: true | 206 | Layout.fillWidth: true | ||
189 | horizontalAlignment: Text.AlignLeft | 207 | horizontalAlignment: Text.AlignLeft | ||
190 | enabled: alternativeResourcesView.count > 1 | 208 | enabled: alternativeResourcesView.count > 1 | ||
191 | text: appInfo.application.displayOrigin | 209 | text: appInfo.application.displayOrigin | ||
210 | elide: Text.ElideRight | ||||
192 | onClicked: originsOverlay.open() | 211 | onClicked: originsOverlay.open() | ||
193 | } | 212 | } | ||
194 | } | 213 | | ||
195 | RowLayout { | 214 | // License row | ||
196 | QQC2.Label { | 215 | QQC2.Label { | ||
216 | Layout.alignment: Qt.AlignRight | ||||
197 | text: i18n("License:") | 217 | text: i18n("License:") | ||
198 | } | 218 | } | ||
199 | LinkButton { | 219 | LinkButton { | ||
220 | elide: Text.ElideRight | ||||
200 | Layout.fillWidth: true | 221 | Layout.fillWidth: true | ||
201 | horizontalAlignment: Text.AlignLeft | 222 | horizontalAlignment: Text.AlignLeft | ||
202 | text: appInfo.application.license | 223 | text: appInfo.application.license | ||
203 | // tooltip: i18n("See full license terms") | 224 | // tooltip: i18n("See full license terms") | ||
204 | onClicked: Qt.openUrlExternally("https://spdx.org/licenses/" + appInfo.application.license + ".html#licenseText") | 225 | onClicked: Qt.openUrlExternally("https://spdx.org/licenses/" + appInfo.application.license + ".html#licenseText") | ||
205 | } | 226 | } | ||
227 | | ||||
228 | // Homepage row | ||||
229 | QQC2.Label { | ||||
230 | readonly property string homepage: application.homepage | ||||
231 | visible: homepage.length > 0 | ||||
232 | Layout.alignment: Qt.AlignRight | ||||
233 | text: i18n("Homepage:") | ||||
234 | } | ||||
235 | LinkButton { | ||||
236 | readonly property string homepage: application.homepage | ||||
237 | visible: homepage.length > 0 | ||||
238 | text: homepage | ||||
239 | onClicked: Qt.openUrlExternally(application.homepage) | ||||
240 | elide: Text.ElideRight | ||||
241 | Layout.fillWidth: true | ||||
242 | horizontalAlignment: Text.AlignLeft | ||||
243 | } | ||||
206 | } | 244 | } | ||
207 | 245 | | |||
208 | ApplicationScreenshots { | 246 | ApplicationScreenshots { | ||
209 | Layout.topMargin: Kirigami.Units.largeSpacing | 247 | Layout.topMargin: Kirigami.Units.largeSpacing | ||
210 | Layout.fillWidth: true | 248 | Layout.fillWidth: true | ||
211 | resource: appInfo.application | 249 | resource: appInfo.application | ||
212 | page: appInfo | 250 | page: appInfo | ||
213 | } | 251 | } | ||
Show All 13 Lines | 260 | QQC2.Label { | |||
227 | onLinkActivated: { | 265 | onLinkActivated: { | ||
228 | var idx = parseInt(link, 10) | 266 | var idx = parseInt(link, 10) | ||
229 | var res = originsOverlay.model.resourceAt(idx) | 267 | var res = originsOverlay.model.resourceAt(idx) | ||
230 | window.stack.pop() | 268 | window.stack.pop() | ||
231 | Navigation.openApplication(res) | 269 | Navigation.openApplication(res) | ||
232 | } | 270 | } | ||
233 | } | 271 | } | ||
234 | 272 | | |||
235 | RowLayout { | | |||
236 | visible: button.text.length > 0 | | |||
237 | QQC2.Label { | | |||
238 | text: i18n("Homepage: ") | | |||
239 | } | | |||
240 | LinkButton { | | |||
241 | id: button | | |||
242 | text: application.homepage | | |||
243 | onClicked: Qt.openUrlExternally(application.homepage) | | |||
244 | } | | |||
245 | } | | |||
246 | | ||||
247 | LinkButton { | 273 | LinkButton { | ||
248 | id: addonsButton | 274 | id: addonsButton | ||
249 | text: i18n("Addons") | 275 | text: i18n("Addons") | ||
250 | visible: addonsView.containsAddons | 276 | visible: addonsView.containsAddons | ||
251 | onClicked: addonsView.sheetOpen = true | 277 | onClicked: addonsView.sheetOpen = true | ||
252 | } | 278 | } | ||
253 | 279 | | |||
254 | LinkButton { | 280 | LinkButton { | ||
Show All 27 Lines |
Why do you put a Text inside a label? Why not use font.bold property of Label itself?