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.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
title: i18n("Create a Space")
Kirigami.Theme.colorSet: Kirigami.Theme.Window
MobileForm.FormCard {
contentItem: ColumnLayout {
spacing: 0
MobileForm.FormCardHeader {
title: i18nc("@title", "Create a Space")
}
MobileForm.FormTextFieldDelegate {
id: nameDelegate
label: i18n("Space name")
}
MobileForm.FormTextFieldDelegate {
id: topicDelegate
label: i18n("Space topic (optional)")
}
MobileForm.FormButtonDelegate {
text: i18n("Create space")
onClicked: {
Controller.createSpace(nameDelegate.text, topicDelegate.text)
root.close()
root.destroy()
}
enabled: nameDelegate.text.length > 0
FormCard.FormHeader {
title: i18nc("@title", "Create a Space")
}
FormCard.FormCard {
FormCard.FormTextFieldDelegate {
id: nameDelegate
label: i18n("Space name")
}
FormCard.FormTextFieldDelegate {
id: topicDelegate
label: i18n("Space topic (optional)")
}
FormCard.FormButtonDelegate {
text: i18n("Create space")
onClicked: {
Controller.createSpace(nameDelegate.text, topicDelegate.text)
root.close()
root.destroy()
}
enabled: nameDelegate.text.length > 0
}
}
}