mirror of
https://github.com/amnezia-vpn/amnezia-client.git
synced 2026-06-21 02:01:03 +07:00
replace FlickableType with ListViewType in PageSettingsConnection
This commit is contained in:
@@ -21,20 +21,25 @@ PageType {
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.topMargin: 20
|
||||
|
||||
onActiveFocusChanged: {
|
||||
if(backButton.enabled && backButton.activeFocus) {
|
||||
listView.positionViewAtBeginning()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
FlickableType {
|
||||
id: fl
|
||||
ListViewType {
|
||||
id: listView
|
||||
|
||||
anchors.top: backButton.bottom
|
||||
anchors.bottom: parent.bottom
|
||||
contentHeight: content.height
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
|
||||
ColumnLayout {
|
||||
id: content
|
||||
header: ColumnLayout {
|
||||
|
||||
anchors.top: parent.top
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
width: listView.width
|
||||
|
||||
BaseHeaderType {
|
||||
Layout.fillWidth: true
|
||||
@@ -43,9 +48,17 @@ PageType {
|
||||
|
||||
headerText: qsTr("Connection")
|
||||
}
|
||||
}
|
||||
|
||||
model: 1 // fake model to force the ListView to be created without a model
|
||||
|
||||
delegate: ColumnLayout { // TODO(CyAn84): add DelegateChooser when have migrated to 6.9
|
||||
|
||||
width: listView.width
|
||||
|
||||
SwitcherType {
|
||||
id: amneziaDnsSwitch
|
||||
|
||||
Layout.fillWidth: true
|
||||
Layout.margins: 16
|
||||
|
||||
@@ -64,14 +77,13 @@ PageType {
|
||||
|
||||
LabelWithButtonType {
|
||||
id: dnsServersButton
|
||||
|
||||
Layout.fillWidth: true
|
||||
|
||||
text: qsTr("DNS servers")
|
||||
descriptionText: qsTr("When AmneziaDNS is not used or installed")
|
||||
rightImageSource: "qrc:/images/controls/chevron-right.svg"
|
||||
|
||||
parentFlickable: fl
|
||||
|
||||
clickedFunction: function() {
|
||||
PageController.goToPage(PageEnum.PageSettingsDns)
|
||||
}
|
||||
@@ -81,14 +93,13 @@ PageType {
|
||||
|
||||
LabelWithButtonType {
|
||||
id: splitTunnelingButton
|
||||
|
||||
Layout.fillWidth: true
|
||||
|
||||
text: qsTr("Site-based split tunneling")
|
||||
descriptionText: qsTr("Allows you to select which sites you want to access through the VPN")
|
||||
rightImageSource: "qrc:/images/controls/chevron-right.svg"
|
||||
|
||||
parentFlickable: fl
|
||||
|
||||
clickedFunction: function() {
|
||||
PageController.goToPage(PageEnum.PageSettingsSplitTunneling)
|
||||
}
|
||||
@@ -96,8 +107,15 @@ PageType {
|
||||
|
||||
DividerType {}
|
||||
|
||||
}
|
||||
|
||||
footer: ColumnLayout { // TODO(CyAn84): move to delegate,add DelegateChooser when have migrated to 6.9
|
||||
|
||||
width: listView.width
|
||||
|
||||
LabelWithButtonType {
|
||||
id: splitTunnelingButton2
|
||||
|
||||
visible: root.isAppSplitTinnelingEnabled
|
||||
|
||||
Layout.fillWidth: true
|
||||
@@ -106,8 +124,6 @@ PageType {
|
||||
descriptionText: qsTr("Allows you to use the VPN only for certain Apps")
|
||||
rightImageSource: "qrc:/images/controls/chevron-right.svg"
|
||||
|
||||
parentFlickable: fl
|
||||
|
||||
clickedFunction: function() {
|
||||
PageController.goToPage(PageEnum.PageSettingsAppSplitTunneling)
|
||||
}
|
||||
@@ -127,8 +143,6 @@ PageType {
|
||||
descriptionText: qsTr("Blocks network connections without VPN")
|
||||
rightImageSource: "qrc:/images/controls/chevron-right.svg"
|
||||
|
||||
parentFlickable: fl
|
||||
|
||||
clickedFunction: function() {
|
||||
PageController.goToPage(PageEnum.PageSettingsKillSwitch)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user