info-kcm: Port to FormCard

This commit is contained in:
Carl Schwan 2023-09-21 20:43:23 +02:00
parent a9906e06b3
commit c039bcef86
No known key found for this signature in database
GPG key ID: 02325448204E452A

View file

@ -10,14 +10,15 @@ import QtQuick.Controls 2.2 as Controls
import org.kde.kcmutils as KCM import org.kde.kcmutils as KCM
import org.kde.kirigami 2.10 as Kirigami import org.kde.kirigami 2.10 as Kirigami
import org.kde.kirigamiaddons.labs.mobileform 0.1 as MobileForm import org.kde.kirigamiaddons.formcard 1 as FormCard
KCM.SimpleKCM { KCM.SimpleKCM {
title: i18n("System Information") title: i18n("System Information")
leftPadding: 0 leftPadding: 0
rightPadding: 0 rightPadding: 0
Kirigami.Theme.colorSet: Kirigami.Theme.Window topPadding: 0
bottomPadding: Kirigami.Units.gridUnit
actions: [ actions: [
Kirigami.Action { Kirigami.Action {
@ -28,7 +29,6 @@ KCM.SimpleKCM {
] ]
ColumnLayout { ColumnLayout {
width: parent.width
spacing: 0 spacing: 0
Kirigami.Icon { Kirigami.Icon {
@ -39,103 +39,85 @@ KCM.SimpleKCM {
implicitHeight: width implicitHeight: width
source: kcm.distroInfo.logo ? kcm.distroInfo.logo : "kde" source: kcm.distroInfo.logo ? kcm.distroInfo.logo : "kde"
} }
MobileForm.FormCard { FormCard.FormCard {
Layout.fillWidth: true Layout.fillWidth: true
contentItem: ColumnLayout { FormCard.FormTextDelegate {
spacing: 0 text: i18n("Operating System")
description: kcm.distroInfo.name
MobileForm.FormTextDelegate { }
text: i18n("Operating System")
description: kcm.distroInfo.name FormCard.FormDelegateSeparator {}
}
FormCard.FormButtonDelegate {
MobileForm.FormDelegateSeparator {} text: i18n("Webpage")
description: kcm.distroInfo.homeUrl
MobileForm.FormButtonDelegate { onClicked: {
text: i18n("Webpage") Qt.openUrlExternally(kcm.distroInfo.homeUrl)
description: kcm.distroInfo.homeUrl
onClicked: {
Qt.openUrlExternally(kcm.distroInfo.homeUrl)
}
} }
} }
} }
MobileForm.FormCard { FormCard.FormHeader {
Layout.fillWidth: true title: i18nc("@title:group", "Software")
Layout.topMargin: Kirigami.Units.gridUnit }
contentItem: ColumnLayout { FormCard.FormCard {
spacing: 0 FormCard.FormTextDelegate {
text: i18n("KDE Plasma Version")
MobileForm.FormCardHeader { description: kcm.softwareInfo.plasmaVersion
title: "Software" }
}
FormCard.FormDelegateSeparator {}
MobileForm.FormTextDelegate {
text: i18n("KDE Plasma Version") FormCard.FormTextDelegate {
description: kcm.softwareInfo.plasmaVersion text: i18n("KDE Frameworks Version")
} description: kcm.softwareInfo.frameworksVersion
}
MobileForm.FormDelegateSeparator {}
FormCard.FormDelegateSeparator {}
MobileForm.FormTextDelegate {
text: i18n("KDE Frameworks Version") FormCard.FormTextDelegate {
description: kcm.softwareInfo.frameworksVersion text: i18n("Qt Version")
} description: kcm.softwareInfo.qtVersion
}
MobileForm.FormDelegateSeparator {}
FormCard.FormDelegateSeparator {}
MobileForm.FormTextDelegate {
text: i18n("Qt Version") FormCard.FormTextDelegate {
description: kcm.softwareInfo.qtVersion text: i18n("Kernel Version")
} description: kcm.softwareInfo.kernelRelease
}
MobileForm.FormDelegateSeparator {}
FormCard.FormDelegateSeparator {}
MobileForm.FormTextDelegate {
text: i18n("Kernel Version") FormCard.FormTextDelegate {
description: kcm.softwareInfo.kernelRelease text: i18n("OS Type")
} description: i18nc("@label %1 is the CPU bit width (e.g. 32 or 64)", "%1-bit", kcm.softwareInfo.osType)
MobileForm.FormDelegateSeparator {}
MobileForm.FormTextDelegate {
text: i18n("OS Type")
description: i18nc("@label %1 is the CPU bit width (e.g. 32 or 64)", "%1-bit", kcm.softwareInfo.osType)
}
} }
} }
MobileForm.FormCard { FormCard.FormHeader {
Layout.fillWidth: true title: i18nc("@title:group", "Hardware")
Layout.topMargin: Kirigami.Units.gridUnit }
contentItem: ColumnLayout { FormCard.FormCard {
spacing: 0 FormCard.FormTextDelegate {
text: i18np("Processor", "Processors", kcm.hardwareInfo.processorCount);
MobileForm.FormCardHeader { description: kcm.hardwareInfo.processors
title: "Hardware" }
}
FormCard.FormDelegateSeparator {}
MobileForm.FormTextDelegate {
text: i18np("Processor", "Processors", kcm.hardwareInfo.processorCount); FormCard.FormTextDelegate {
description: kcm.hardwareInfo.processors text: i18n("Memory")
} description: {
if (kcm.hardwareInfo.memory !== "0 B") {
MobileForm.FormDelegateSeparator {} return i18nc("@label %1 is the formatted amount of system memory (e.g. 7,7 GiB)",
"%1 of RAM", kcm.hardwareInfo.memory)
MobileForm.FormTextDelegate { } else {
text: i18n("Memory") return i18nc("Unknown amount of RAM", "Unknown")
description: {
if (kcm.hardwareInfo.memory !== "0 B") {
return i18nc("@label %1 is the formatted amount of system memory (e.g. 7,7 GiB)",
"%1 of RAM", kcm.hardwareInfo.memory)
} else {
return i18nc("Unknown amount of RAM", "Unknown")
}
} }
} }
} }