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