Port SonnetConfigPage to FormCard
This commit is contained in:
@@ -7,31 +7,20 @@ import QtQuick.Controls 2.15 as QQC2
|
||||
import QtQuick.Layouts 1.15
|
||||
import org.kde.kirigami 2.15 as Kirigami
|
||||
import org.kde.sonnet 1.0 as Sonnet
|
||||
import org.kde.kirigamiaddons.labs.mobileform 0.1 as MobileForm
|
||||
import org.kde.kirigamiaddons.formcard 1.0 as FormCard
|
||||
|
||||
Kirigami.ScrollablePage {
|
||||
id: page
|
||||
topPadding: 0
|
||||
leftPadding: 0
|
||||
rightPadding: 0
|
||||
id: root
|
||||
|
||||
ColumnLayout {
|
||||
spacing: 0
|
||||
MobileForm.FormHeader {
|
||||
Layout.fillWidth: true
|
||||
title: i18n("Spellchecking")
|
||||
FormCard.FormHeader {
|
||||
title: i18nc("@title", "Spellchecking")
|
||||
}
|
||||
MobileForm.FormCard {
|
||||
FormCard.FormCard {
|
||||
id: card
|
||||
Sonnet.Settings {
|
||||
property Sonnet.Settings settings: Sonnet.Settings {
|
||||
id: settings
|
||||
}
|
||||
|
||||
Layout.fillWidth: true
|
||||
|
||||
contentItem: ColumnLayout {
|
||||
spacing: 0
|
||||
MobileForm.FormCheckDelegate {
|
||||
FormCard.FormCheckDelegate {
|
||||
id: enable
|
||||
checked: settings.checkerEnabledByDefault
|
||||
text: i18n("Enable automatic spell checking")
|
||||
@@ -41,9 +30,9 @@ Kirigami.ScrollablePage {
|
||||
}
|
||||
}
|
||||
|
||||
MobileForm.FormDelegateSeparator { below: enable; above: skipUppercase }
|
||||
FormCard.FormDelegateSeparator { below: enable; above: skipUppercase }
|
||||
|
||||
MobileForm.FormCheckDelegate {
|
||||
FormCard.FormCheckDelegate {
|
||||
id: skipUppercase
|
||||
checked: settings.skipUppercase
|
||||
text: i18n("Ignore uppercase words")
|
||||
@@ -53,9 +42,9 @@ Kirigami.ScrollablePage {
|
||||
}
|
||||
}
|
||||
|
||||
MobileForm.FormDelegateSeparator { below: skipUppercase; above: skipRunTogether }
|
||||
FormCard.FormDelegateSeparator { below: skipUppercase; above: skipRunTogether }
|
||||
|
||||
MobileForm.FormCheckDelegate {
|
||||
FormCard.FormCheckDelegate {
|
||||
id: skipRunTogether
|
||||
checked: settings.skipRunTogether
|
||||
text: i18n("Ignore hyphenated words")
|
||||
@@ -65,9 +54,9 @@ Kirigami.ScrollablePage {
|
||||
}
|
||||
}
|
||||
|
||||
MobileForm.FormDelegateSeparator { below: skipRunTogether; above: autodetectLanguageCheckbox }
|
||||
FormCard.FormDelegateSeparator { below: skipRunTogether; above: autodetectLanguageCheckbox }
|
||||
|
||||
MobileForm.FormCheckDelegate {
|
||||
FormCard.FormCheckDelegate {
|
||||
id: autodetectLanguageCheckbox
|
||||
checked: settings.autodetectLanguage
|
||||
text: i18n("Detect language automatically")
|
||||
@@ -77,14 +66,14 @@ Kirigami.ScrollablePage {
|
||||
}
|
||||
}
|
||||
|
||||
MobileForm.FormDelegateSeparator { below: autodetectLanguageCheckbox; above: selectedDefaultLanguage }
|
||||
FormCard.FormDelegateSeparator { below: autodetectLanguageCheckbox; above: selectedDefaultLanguage }
|
||||
|
||||
MobileForm.FormComboBoxDelegate {
|
||||
FormCard.FormComboBoxDelegate {
|
||||
id: selectedDefaultLanguage
|
||||
text: i18n("Selected default language:")
|
||||
model: isEmpty ? [{"display": i18n("None")}] : settings.dictionaryModel
|
||||
textRole: "display"
|
||||
displayMode: Kirigami.Settings.isMobile ? MobileForm.FormComboBoxDelegate.Dialog : MobileForm.FormComboBoxDelegate.Page
|
||||
displayMode: Kirigami.Settings.isMobile ? FormCard.FormComboBoxDelegate.Dialog : FormCard.FormComboBoxDelegate.Page
|
||||
valueRole: "languageCode"
|
||||
property bool isEmpty: false
|
||||
Component.onCompleted: {
|
||||
@@ -97,9 +86,9 @@ Kirigami.ScrollablePage {
|
||||
onActivated: settings.defaultLanguage = currentValue;
|
||||
}
|
||||
|
||||
MobileForm.FormDelegateSeparator { below: selectedDefaultLanguage; above: spellCheckingLanguage }
|
||||
FormCard.FormDelegateSeparator { below: selectedDefaultLanguage; above: spellCheckingLanguage }
|
||||
|
||||
MobileForm.FormButtonDelegate {
|
||||
FormCard.FormButtonDelegate {
|
||||
id: spellCheckingLanguage
|
||||
text: i18n("Additional spell checking languages")
|
||||
description: i18n("%1 will provide spell checking and suggestions for the languages listed here when autodetection is enabled.", Qt.application.displayName)
|
||||
@@ -110,9 +99,9 @@ Kirigami.ScrollablePage {
|
||||
})
|
||||
}
|
||||
|
||||
MobileForm.FormDelegateSeparator { below: spellCheckingLanguageList; above: personalDictionary }
|
||||
FormCard.FormDelegateSeparator { below: spellCheckingLanguageList; above: personalDictionary }
|
||||
|
||||
MobileForm.FormButtonDelegate {
|
||||
FormCard.FormButtonDelegate {
|
||||
id: personalDictionary
|
||||
text: i18n("Open Personal Dictionary")
|
||||
onClicked: pageStack.pushDialogLayer(dictionaryPage, {}, {
|
||||
@@ -121,7 +110,7 @@ Kirigami.ScrollablePage {
|
||||
})
|
||||
}
|
||||
|
||||
Component {
|
||||
property Component spellCheckingLanguageList: Component {
|
||||
id: spellCheckingLanguageList
|
||||
Kirigami.ScrollablePage {
|
||||
id: scroll
|
||||
@@ -212,6 +201,4 @@ Kirigami.ScrollablePage {
|
||||
return value !== word;
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user