Port CreateSpaceDialog to FormCard

This commit is contained in:
Tobias Fella
2023-09-01 18:11:38 +02:00
parent 87745c360d
commit 5871903529

View File

@@ -6,38 +6,35 @@ import QtQuick.Layouts 1.15
import org.kde.kirigami 2.20 as Kirigami import org.kde.kirigami 2.20 as Kirigami
import org.kde.neochat 1.0 import org.kde.neochat 1.0
import org.kde.kirigamiaddons.labs.mobileform 0.1 as MobileForm import org.kde.kirigamiaddons.formcard 1.0 as FormCard
Kirigami.ScrollablePage { FormCard.FormCardPage {
id: root id: root
title: i18n("Create a Space") title: i18n("Create a Space")
Kirigami.Theme.colorSet: Kirigami.Theme.Window Kirigami.Theme.colorSet: Kirigami.Theme.Window
MobileForm.FormCard { FormCard.FormHeader {
contentItem: ColumnLayout { title: i18nc("@title", "Create a Space")
spacing: 0 }
MobileForm.FormCardHeader { FormCard.FormCard {
title: i18nc("@title", "Create a Space") FormCard.FormTextFieldDelegate {
} id: nameDelegate
MobileForm.FormTextFieldDelegate { label: i18n("Space name")
id: nameDelegate }
label: i18n("Space name") FormCard.FormTextFieldDelegate {
} id: topicDelegate
MobileForm.FormTextFieldDelegate { label: i18n("Space topic (optional)")
id: topicDelegate }
label: i18n("Space topic (optional)") FormCard.FormButtonDelegate {
} text: i18n("Create space")
MobileForm.FormButtonDelegate { onClicked: {
text: i18n("Create space") Controller.createSpace(nameDelegate.text, topicDelegate.text)
onClicked: { root.close()
Controller.createSpace(nameDelegate.text, topicDelegate.text) root.destroy()
root.close()
root.destroy()
}
enabled: nameDelegate.text.length > 0
} }
enabled: nameDelegate.text.length > 0
} }
} }
} }