Changeset View
Changeset View
Standalone View
Standalone View
discover/qml/ApplicationPage.qml
Show All 30 Lines | |||||
31 | DiscoverPage { | 31 | DiscoverPage { | ||
32 | id: appInfo | 32 | id: appInfo | ||
33 | property QtObject application: null | 33 | property QtObject application: null | ||
34 | clip: true | 34 | clip: true | ||
35 | 35 | | |||
36 | title: application.name | 36 | title: application.name | ||
37 | 37 | | |||
38 | background: Rectangle { color: Kirigami.Theme.viewBackgroundColor } | 38 | background: Rectangle { color: Kirigami.Theme.viewBackgroundColor } | ||
39 | 39 | | |||
apol: Here actually we probably want to be a bit smarter. If it's updateable we probably want to… | |||||
40 | ReviewsPage { | 40 | ReviewsPage { | ||
41 | id: reviewsSheet | 41 | id: reviewsSheet | ||
42 | model: ReviewsModel { | 42 | model: ReviewsModel { | ||
43 | id: reviewsModel | 43 | id: reviewsModel | ||
44 | resource: appInfo.application | 44 | resource: appInfo.application | ||
45 | } | 45 | } | ||
46 | } | 46 | } | ||
47 | 47 | | |||
▲ Show 20 Lines • Show All 201 Lines • ▼ Show 20 Line(s) | 240 | GridLayout { | |||
249 | QQC2.Label { | 249 | QQC2.Label { | ||
250 | Layout.fillWidth: true | 250 | Layout.fillWidth: true | ||
251 | elide: Text.ElideRight | 251 | elide: Text.ElideRight | ||
252 | text: appInfo.application.categoryDisplay | 252 | text: appInfo.application.categoryDisplay | ||
253 | } | 253 | } | ||
254 | 254 | | |||
255 | // Version row | 255 | // Version row | ||
256 | QQC2.Label { | 256 | QQC2.Label { | ||
257 | readonly property string version: appInfo.application.isInstalled ? appInfo.application.installedVersion : appInfo.application.availableVersion | 257 | visible: versionLabel.visible | ||
258 | visible: version.length > 0 | | |||
259 | Layout.alignment: Qt.AlignRight | 258 | Layout.alignment: Qt.AlignRight | ||
260 | text: i18n("Version:") | 259 | text: i18n("Version:") | ||
261 | } | 260 | } | ||
262 | QQC2.Label { | 261 | QQC2.Label { | ||
263 | readonly property string version: appInfo.application.isInstalled ? appInfo.application.installedVersion : appInfo.application.availableVersion | 262 | readonly property string version: appInfo.application.isInstalled ? appInfo.application.installedVersion : appInfo.application.availableVersion | ||
264 | visible: version.length > 0 | 263 | id: versionLabel | ||
264 | visible: text.length > 0 | ||||
265 | Layout.fillWidth: true | 265 | Layout.fillWidth: true | ||
266 | elide: Text.ElideRight | 266 | elide: Text.ElideRight | ||
267 | text: version ? version : "" | 267 | text: version ? version : "" | ||
268 | } | 268 | } | ||
269 | 269 | | |||
270 | // Size row | 270 | // Size row | ||
271 | QQC2.Label { | 271 | QQC2.Label { | ||
272 | Layout.alignment: Qt.AlignRight | 272 | Layout.alignment: Qt.AlignRight | ||
Show All 32 Lines | 301 | LinkButton { | |||
305 | visible: text.length>0 | 305 | visible: text.length>0 | ||
306 | text: appInfo.application.license | 306 | text: appInfo.application.license | ||
307 | // tooltip: i18n("See full license terms") | 307 | // tooltip: i18n("See full license terms") | ||
308 | onClicked: Qt.openUrlExternally("https://spdx.org/licenses/" + appInfo.application.license + ".html#licenseText") | 308 | onClicked: Qt.openUrlExternally("https://spdx.org/licenses/" + appInfo.application.license + ".html#licenseText") | ||
309 | } | 309 | } | ||
310 | 310 | | |||
311 | // Homepage row | 311 | // Homepage row | ||
312 | QQC2.Label { | 312 | QQC2.Label { | ||
313 | readonly property string homepage: application.homepage | 313 | visible: homepageLink.visible | ||
314 | visible: homepage.length > 0 | | |||
315 | Layout.alignment: Qt.AlignRight | 314 | Layout.alignment: Qt.AlignRight | ||
316 | text: i18n("Homepage:") | 315 | text: i18n("Homepage:") | ||
317 | } | 316 | } | ||
318 | LinkButton { | 317 | LinkButton { | ||
319 | readonly property string homepage: application.homepage | 318 | id: homepageLink | ||
320 | visible: homepage.length > 0 | 319 | visible: text.length > 0 | ||
321 | text: homepage | 320 | text: application.homepage | ||
322 | onClicked: Qt.openUrlExternally(application.homepage) | 321 | onClicked: Qt.openUrlExternally(application.homepage) | ||
323 | elide: Text.ElideRight | 322 | elide: Text.ElideRight | ||
324 | Layout.fillWidth: true | 323 | Layout.fillWidth: true | ||
325 | horizontalAlignment: Text.AlignLeft | 324 | horizontalAlignment: Text.AlignLeft | ||
326 | } | 325 | } | ||
326 | | ||||
327 | // "User Guide" row | ||||
328 | QQC2.Label { | ||||
329 | visible: docsLink.visible | ||||
330 | Layout.alignment: Qt.AlignRight | ||||
331 | text: i18n("User Guide:") | ||||
332 | } | ||||
333 | LinkButton { | ||||
334 | id: docsLink | ||||
335 | visible: text.length > 0 | ||||
336 | text: application.helpURL | ||||
No need to put it in a separte property. And specially don't add the exact same 2 properties! apol: No need to put it in a separte property. And specially don't add the exact same 2 properties! | |||||
337 | onClicked: Qt.openUrlExternally(helpURL) | ||||
338 | elide: Text.ElideRight | ||||
339 | Layout.fillWidth: true | ||||
340 | horizontalAlignment: Text.AlignLeft | ||||
341 | } | ||||
342 | | ||||
343 | // Donate row | ||||
344 | QQC2.Label { | ||||
345 | visible: donationLink.visible | ||||
346 | Layout.alignment: Qt.AlignRight | ||||
347 | text: i18n("Donate:") | ||||
Donation:? Donate:? "Make a donation" reads a bit too long to me for such a title. apol: Donation:? Donate:?
"Make a donation" reads a bit too long to me for such a title. | |||||
"Donate: sounds good. "Make a Donation:" would probably be 4 lines long in German, anyway. :) ngraham: "Donate: sounds good. "Make a Donation:" would probably be 4 lines long in German, anyway. :) | |||||
348 | } | ||||
349 | LinkButton { | ||||
350 | id: donationLink | ||||
How about: QQC2.Label { visible: donationButton.visible Layout.alignment: Qt.AlignRight text: i18n("Make a Donation:") } LinkButton { id: donationButton visible: text.length > 0 text: application.donationURL onClicked: Qt.openUrlExternally(donationURL) elide: Text.ElideRight Layout.fillWidth: true horizontalAlignment: Text.AlignLeft } This way we don't need to have random top-level properties for every single thing. apol: How about:
```
QQC2.Label {
visible: donationButton.visible… | |||||
351 | visible: text.length > 0 | ||||
352 | text: application.donationURL | ||||
353 | onClicked: Qt.openUrlExternally(donationURL) | ||||
354 | elide: Text.ElideRight | ||||
355 | Layout.fillWidth: true | ||||
356 | horizontalAlignment: Text.AlignLeft | ||||
357 | } | ||||
358 | | ||||
359 | // "Report a Droblem" row | ||||
360 | QQC2.Label { | ||||
361 | visible: bugLink.visible | ||||
362 | Layout.alignment: Qt.AlignRight | ||||
363 | text: i18n("Report a Problem:") | ||||
364 | } | ||||
365 | LinkButton { | ||||
366 | id: bugLink | ||||
367 | visible: text.length > 0 | ||||
368 | text: application.bugURL | ||||
369 | onClicked: Qt.openUrlExternally(bugURL) | ||||
370 | elide: Text.ElideRight | ||||
371 | Layout.fillWidth: true | ||||
372 | horizontalAlignment: Text.AlignLeft | ||||
373 | } | ||||
327 | } | 374 | } | ||
328 | } | 375 | } | ||
apol: it's missing the rest, no?
| |||||
329 | 376 | | |||
330 | readonly property var addons: AddonsView { | 377 | readonly property var addons: AddonsView { | ||
331 | id: addonsView | 378 | id: addonsView | ||
332 | application: appInfo.application | 379 | application: appInfo.application | ||
333 | parent: overlay | 380 | parent: overlay | ||
334 | } | 381 | } | ||
335 | } | 382 | } |
Here actually we probably want to be a bit smarter. If it's updateable we probably want to reflect it as well.