Port proxy page to formcard

This commit is contained in:
Tobias Fella
2023-09-01 17:06:27 +02:00
parent ddd690f6d5
commit 7ba63eb680

View File

@@ -6,29 +6,23 @@ import QtQuick.Controls 2.15 as QQC2
import QtQuick.Layouts 1.15
import org.kde.kirigami 2.15 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
title: i18nc("@title:window", "General")
property int currentType
property bool proxyConfigChanged: false
topPadding: 0
leftPadding: 0
rightPadding: 0
ColumnLayout {
spacing: 0
MobileForm.FormHeader {
Layout.fillWidth: true
FormCard.FormHeader {
title: i18n("Network Proxy")
}
MobileForm.FormCard {
Layout.fillWidth: true
contentItem: ColumnLayout {
spacing: 0
MobileForm.FormRadioDelegate {
FormCard.FormCard {
FormCard.FormRadioDelegate {
text: i18n("System Default")
checked: currentType === 0
enabled: !Config.isProxyTypeImmutable
@@ -36,7 +30,7 @@ Kirigami.ScrollablePage {
currentType = 0
}
}
MobileForm.FormRadioDelegate {
FormCard.FormRadioDelegate {
text: i18n("HTTP")
checked: currentType === 1
enabled: !Config.isProxyTypeImmutable
@@ -44,7 +38,7 @@ Kirigami.ScrollablePage {
currentType = 1
}
}
MobileForm.FormRadioDelegate {
FormCard.FormRadioDelegate {
text: i18n("Socks5")
checked: currentType === 2
enabled: !Config.isProxyTypeImmutable
@@ -53,17 +47,12 @@ Kirigami.ScrollablePage {
}
}
}
}
MobileForm.FormHeader {
Layout.fillWidth: true
FormCard.FormHeader {
title: i18n("Proxy Settings")
}
MobileForm.FormCard {
Layout.fillWidth: true
contentItem: ColumnLayout {
spacing: 0
MobileForm.FormTextFieldDelegate {
FormCard.FormCard {
FormCard.FormTextFieldDelegate {
id: hostField
label: i18n("Host")
text: Config.proxyHost
@@ -72,7 +61,7 @@ Kirigami.ScrollablePage {
proxyConfigChanged = true
}
}
MobileForm.FormSpinBoxDelegate {
FormCard.FormSpinBoxDelegate {
id: portField
label: i18n("Port")
value: Config.proxyPort
@@ -85,7 +74,7 @@ Kirigami.ScrollablePage {
proxyConfigChanged = true
}
}
MobileForm.FormTextFieldDelegate {
FormCard.FormTextFieldDelegate {
id: userField
label: i18n("User")
text: Config.proxyUser
@@ -94,7 +83,7 @@ Kirigami.ScrollablePage {
proxyConfigChanged = true
}
}
MobileForm.FormTextFieldDelegate {
FormCard.FormTextFieldDelegate {
id: passwordField
label: i18n("Password")
text: Config.proxyPassword
@@ -105,8 +94,6 @@ Kirigami.ScrollablePage {
}
}
}
}
}
footer: QQC2.ToolBar {
height: visible ? implicitHeight : 0