Port EmoticonEditorPage to FormCard

This commit is contained in:
Tobias Fella
2023-09-01 18:08:21 +02:00
parent 40d2eb5aba
commit 87745c360d

View File

@@ -8,11 +8,11 @@ import Qt.labs.platform 1.1
import QtQuick.Window 2.15
import org.kde.kirigami 2.19 as Kirigami
import org.kde.kirigamiaddons.labs.mobileform 0.1 as MobileForm
import org.kde.kirigamiaddons.formcard 1.0 as FormCard
import org.kde.neochat 1.0
Kirigami.ScrollablePage {
FormCard.FormCardPage {
id: root
required property string description
@@ -24,25 +24,14 @@ Kirigami.ScrollablePage {
property bool newEmoticon: false
required property var emoticonType
topPadding: 0
leftPadding: 0
rightPadding: 0
title: emoticonType === EmoticonFormCard.Stickers ? (newEmoticon ? i18nc("@title", "Add Sticker") : i18nc("@title", "Edit Sticker"))
: (newEmoticon ? i18nc("@title", "Add Emoji") : i18nc("@title", "Edit Emoji"))
ColumnLayout {
spacing: 0
MobileForm.FormHeader {
Layout.fillWidth: true
FormCard.FormHeader {
title: emoticonType === EmoticonFormCard.Stickers ? i18n("Sticker") : i18n("Emoji")
}
MobileForm.FormCard {
Layout.fillWidth: true
contentItem: ColumnLayout {
spacing: 0
MobileForm.AbstractFormDelegate {
Layout.fillWidth: true
FormCard.FormCard {
FormCard.AbstractFormDelegate {
background: Item {}
contentItem: RowLayout {
Item {
@@ -106,17 +95,17 @@ Kirigami.ScrollablePage {
}
}
}
MobileForm.FormTextFieldDelegate {
FormCard.FormTextFieldDelegate {
id: shortcode
label: i18n("Shortcode:")
text: root.shortcode
}
MobileForm.FormTextFieldDelegate {
FormCard.FormTextFieldDelegate {
id: description
label: i18n("Description:")
text: root.description
}
MobileForm.FormButtonDelegate {
FormCard.FormButtonDelegate {
id: save
text: i18n("Save")
icon.name: "document-save"
@@ -139,9 +128,7 @@ Kirigami.ScrollablePage {
}
}
}
}
}
Component {
property Component openFileDialog: Component {
id: openFileDialog
OpenFileDialog {