hotspot-kcm: Port to FormCard

This commit is contained in:
Carl Schwan 2023-09-21 19:30:04 +02:00
parent 69dc189941
commit dc047a0eb9
No known key found for this signature in database
GPG key ID: 02325448204E452A

View file

@ -9,35 +9,33 @@ import QtQuick.Controls as Controls
import org.kde.plasma.networkmanagement as PlasmaNM import org.kde.plasma.networkmanagement as PlasmaNM
import org.kde.kirigami as Kirigami import org.kde.kirigami as Kirigami
import org.kde.kcmutils import org.kde.kcmutils
import org.kde.kirigamiaddons.labs.mobileform as MobileForm import org.kde.kirigamiaddons.formcard as FormCard
SimpleKCM { SimpleKCM {
id: root id: root
leftPadding: 0 leftPadding: 0
rightPadding: 0 rightPadding: 0
topPadding: Kirigami.Units.gridUnit topPadding: 0
bottomPadding: Kirigami.Units.gridUnit bottomPadding: 0
ColumnLayout {
spacing: 0
width: root.width
data: [
PlasmaNM.Handler { PlasmaNM.Handler {
id: handler id: handler
} },
PlasmaNM.WirelessStatus { PlasmaNM.WirelessStatus {
id: wirelessStatus id: wirelessStatus
} }
]
MobileForm.FormCard { ColumnLayout {
Layout.fillWidth: true
contentItem: ColumnLayout {
spacing: 0 spacing: 0
MobileForm.FormSwitchDelegate { FormCard.FormCard {
Layout.topMargin: Kirigami.Units.gridUnit
FormCard.FormSwitchDelegate {
id: hotspotToggle id: hotspotToggle
text: i18n("Hotspot") text: i18n("Hotspot")
description: i18n("Whether the wireless hotspot is enabled."); description: i18n("Whether the wireless hotspot is enabled.");
@ -53,25 +51,21 @@ SimpleKCM {
} }
} }
} }
}
MobileForm.FormCard { FormCard.FormCard {
Layout.fillWidth: true
Layout.topMargin: Kirigami.Units.gridUnit Layout.topMargin: Kirigami.Units.gridUnit
Layout.bottomMargin: Kirigami.Units.gridUnit
contentItem: ColumnLayout { FormCard.FormTextFieldDelegate {
spacing: 0
MobileForm.FormTextFieldDelegate {
label: i18n("Hotspot SSID") label: i18n("Hotspot SSID")
enabled: !hotspotToggle.checked enabled: !hotspotToggle.checked
text: PlasmaNM.Configuration.hotspotName text: PlasmaNM.Configuration.hotspotName
onTextChanged: PlasmaNM.Configuration.hotspotName = text onTextChanged: PlasmaNM.Configuration.hotspotName = text
} }
MobileForm.FormDelegateSeparator {} FormCard.FormDelegateSeparator {}
MobileForm.FormTextFieldDelegate { FormCard.FormTextFieldDelegate {
label: i18n("Hotspot Password") label: i18n("Hotspot Password")
enabled: !hotspotToggle.checked enabled: !hotspotToggle.checked
echoMode: TextInput.Password echoMode: TextInput.Password
@ -80,5 +74,4 @@ SimpleKCM {
} }
} }
} }
}
} }