Commit c4a74b53 authored by Nate Graham's avatar Nate Graham 🔩

Show release date inline with version string

Summary:
The release date is inherently tied to a specific version, so display the two together.

CCBUG: 395677

Test Plan:
{F5926563}

Also tested apps with no version and apps with a version but no release date; no regressions.

Reviewers: #discover_software_store, apol

Reviewed By: #discover_software_store, apol

Subscribers: apol, colomar, plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D13656
parent 8f70aa71
......@@ -265,20 +265,6 @@ DiscoverPage {
rowSpacing: 0
columns: 2
// Date row
Label {
Layout.alignment: Qt.AlignRight
text: i18n("Release date:")
visible: releaseDateLabel.text.length !== 0
}
Label {
id: releaseDateLabel
Layout.fillWidth: true
elide: Text.ElideRight
text: appInfo.application.releaseDate.toDateString()
visible: releaseDateLabel.text.length !== 0
}
// Category row
Label {
Layout.alignment: Qt.AlignRight
......@@ -298,11 +284,25 @@ DiscoverPage {
}
Label {
readonly property string version: appInfo.application.isInstalled ? appInfo.application.installedVersion : appInfo.application.availableVersion
readonly property string releaseDate: appInfo.application.releaseDate.toDateString()
function versionString() {
if (version.length == 0) {
return ""
} else {
if (releaseDate.length > 0) {
return i18n("%1, released on %2", version, releaseDate)
} else {
return version
}
}
}
id: versionLabel
visible: text.length > 0
Layout.fillWidth: true
elide: Text.ElideRight
text: version ? version : ""
text: versionString()
}
// Size row
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment