mirror of
https://github.com/amnezia-vpn/amnezia-client.git
synced 2026-06-24 02:00:24 +07:00
Refactor: Replace HeaderType with new Types for headers in QML pages
This commit is contained in:
@@ -56,7 +56,7 @@ PageType {
|
||||
anchors.rightMargin: 16
|
||||
anchors.leftMargin: 16
|
||||
|
||||
HeaderType {
|
||||
BaseHeaderType {
|
||||
Layout.fillWidth: true
|
||||
Layout.topMargin: 20
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ PageType {
|
||||
header: ColumnLayout {
|
||||
width: listView.width
|
||||
|
||||
HeaderType {
|
||||
BaseHeaderType {
|
||||
id: header
|
||||
|
||||
Layout.fillWidth: true
|
||||
|
||||
@@ -91,7 +91,7 @@ PageType {
|
||||
|
||||
spacing: 0
|
||||
|
||||
HeaderType {
|
||||
BaseHeaderType {
|
||||
Layout.fillWidth: true
|
||||
|
||||
headerText: qsTr("AmneziaWG settings")
|
||||
|
||||
@@ -91,7 +91,7 @@ PageType {
|
||||
|
||||
spacing: 0
|
||||
|
||||
HeaderType {
|
||||
BaseHeaderType {
|
||||
Layout.fillWidth: true
|
||||
|
||||
headerText: qsTr("AmneziaWG settings")
|
||||
|
||||
@@ -76,7 +76,7 @@ PageType {
|
||||
|
||||
spacing: 0
|
||||
|
||||
HeaderType {
|
||||
BaseHeaderType {
|
||||
Layout.fillWidth: true
|
||||
|
||||
headerText: qsTr("Cloak settings")
|
||||
|
||||
@@ -75,7 +75,7 @@ PageType {
|
||||
|
||||
spacing: 0
|
||||
|
||||
HeaderType {
|
||||
BaseHeaderType {
|
||||
Layout.fillWidth: true
|
||||
|
||||
headerText: qsTr("OpenVPN settings")
|
||||
|
||||
@@ -32,7 +32,7 @@ PageType {
|
||||
id: backButton
|
||||
}
|
||||
|
||||
HeaderType {
|
||||
BaseHeaderType {
|
||||
Layout.fillWidth: true
|
||||
Layout.leftMargin: 16
|
||||
Layout.rightMargin: 16
|
||||
|
||||
@@ -78,7 +78,7 @@ PageType {
|
||||
|
||||
spacing: 0
|
||||
|
||||
HeaderType {
|
||||
BaseHeaderType {
|
||||
Layout.fillWidth: true
|
||||
|
||||
headerText: qsTr("Shadowsocks settings")
|
||||
|
||||
@@ -85,7 +85,7 @@ PageType {
|
||||
|
||||
spacing: 0
|
||||
|
||||
HeaderType {
|
||||
BaseHeaderType {
|
||||
Layout.fillWidth: true
|
||||
|
||||
headerText: qsTr("WG settings")
|
||||
|
||||
@@ -77,7 +77,7 @@ PageType {
|
||||
|
||||
spacing: 0
|
||||
|
||||
HeaderType {
|
||||
BaseHeaderType {
|
||||
Layout.fillWidth: true
|
||||
headerText: qsTr("WG settings")
|
||||
}
|
||||
|
||||
@@ -75,7 +75,7 @@ PageType {
|
||||
|
||||
spacing: 0
|
||||
|
||||
HeaderType {
|
||||
BaseHeaderType {
|
||||
Layout.fillWidth: true
|
||||
headerText: qsTr("XRay settings")
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ PageType {
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
|
||||
HeaderType {
|
||||
BaseHeaderType {
|
||||
id: header
|
||||
|
||||
Layout.fillWidth: true
|
||||
|
||||
@@ -85,7 +85,7 @@ PageType {
|
||||
|
||||
spacing: 0
|
||||
|
||||
HeaderType {
|
||||
BaseHeaderType {
|
||||
Layout.fillWidth: true
|
||||
Layout.leftMargin: 16
|
||||
Layout.rightMargin: 16
|
||||
|
||||
@@ -77,7 +77,7 @@ PageType {
|
||||
|
||||
spacing: 0
|
||||
|
||||
HeaderType {
|
||||
BaseHeaderType {
|
||||
Layout.fillWidth: true
|
||||
Layout.leftMargin: 16
|
||||
Layout.rightMargin: 16
|
||||
@@ -217,7 +217,7 @@ PageType {
|
||||
}
|
||||
}
|
||||
|
||||
HeaderType {
|
||||
BaseHeaderType {
|
||||
Layout.fillWidth: true
|
||||
|
||||
headerText: qsTr("SOCKS5 settings")
|
||||
|
||||
@@ -54,7 +54,7 @@ PageType {
|
||||
|
||||
spacing: 0
|
||||
|
||||
HeaderType {
|
||||
BaseHeaderType {
|
||||
Layout.fillWidth: true
|
||||
Layout.leftMargin: 16
|
||||
Layout.rightMargin: 16
|
||||
|
||||
@@ -29,7 +29,7 @@ PageType {
|
||||
|
||||
spacing: 0
|
||||
|
||||
HeaderType {
|
||||
BaseHeaderType {
|
||||
id: header
|
||||
Layout.fillWidth: true
|
||||
Layout.topMargin: 24
|
||||
|
||||
@@ -69,7 +69,7 @@ PageType {
|
||||
Layout.topMargin: 20
|
||||
}
|
||||
|
||||
HeaderType {
|
||||
HeaderTypeWithButton {
|
||||
id: headerContent
|
||||
objectName: "headerContent"
|
||||
|
||||
|
||||
@@ -91,7 +91,7 @@ PageType {
|
||||
id: backButton
|
||||
}
|
||||
|
||||
HeaderType {
|
||||
BaseHeaderType {
|
||||
id: header
|
||||
|
||||
Layout.fillWidth: true
|
||||
|
||||
@@ -38,7 +38,7 @@ PageType {
|
||||
id: backButton
|
||||
}
|
||||
|
||||
HeaderType {
|
||||
BaseHeaderType {
|
||||
id: header
|
||||
|
||||
Layout.fillWidth: true
|
||||
|
||||
@@ -93,7 +93,7 @@ PageType {
|
||||
Layout.topMargin: 20
|
||||
}
|
||||
|
||||
HeaderType {
|
||||
HeaderTypeWithButton {
|
||||
id: headerContent
|
||||
objectName: "headerContent"
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ PageType {
|
||||
}
|
||||
|
||||
|
||||
HeaderType {
|
||||
BaseHeaderType {
|
||||
id: header
|
||||
|
||||
Layout.fillWidth: true
|
||||
|
||||
@@ -79,29 +79,22 @@ PageType {
|
||||
id: backButton
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
HeaderType {
|
||||
Layout.fillWidth: true
|
||||
Layout.leftMargin: 16
|
||||
HeaderTypeWithSwitcher {
|
||||
Layout.fillWidth: true
|
||||
Layout.leftMargin: 16
|
||||
Layout.rightMargin: 16
|
||||
|
||||
headerText: qsTr("App split tunneling")
|
||||
headerText: qsTr("App split tunneling")
|
||||
|
||||
enabled: root.pageEnabled
|
||||
showSwitcher: true
|
||||
switcher {
|
||||
checked: AppSplitTunnelingModel.isTunnelingEnabled
|
||||
enabled: root.pageEnabled
|
||||
}
|
||||
|
||||
SwitcherType {
|
||||
id: switcher
|
||||
|
||||
Layout.fillWidth: true
|
||||
Layout.rightMargin: 16
|
||||
|
||||
enabled: root.pageEnabled
|
||||
|
||||
checked: AppSplitTunnelingModel.isTunnelingEnabled
|
||||
onToggled: {
|
||||
AppSplitTunnelingModel.toggleSplitTunneling(checked)
|
||||
selector.text = root.routeModesModel[getRouteModesModelIndex()].name
|
||||
}
|
||||
switcherFunction: function(checked) {
|
||||
AppSplitTunnelingModel.toggleSplitTunneling(checked)
|
||||
selector.text = root.routeModesModel[getRouteModesModelIndex()].name
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ PageType {
|
||||
|
||||
spacing: 0
|
||||
|
||||
HeaderType {
|
||||
BaseHeaderType {
|
||||
Layout.fillWidth: true
|
||||
Layout.leftMargin: 16
|
||||
Layout.rightMargin: 16
|
||||
|
||||
@@ -60,7 +60,7 @@ PageType {
|
||||
|
||||
spacing: 16
|
||||
|
||||
HeaderType {
|
||||
BaseHeaderType {
|
||||
Layout.fillWidth: true
|
||||
|
||||
headerText: qsTr("Back up your configuration")
|
||||
|
||||
@@ -36,7 +36,7 @@ PageType {
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
|
||||
HeaderType {
|
||||
BaseHeaderType {
|
||||
Layout.fillWidth: true
|
||||
Layout.leftMargin: 16
|
||||
Layout.rightMargin: 16
|
||||
|
||||
@@ -50,7 +50,7 @@ PageType {
|
||||
|
||||
spacing: 16
|
||||
|
||||
HeaderType {
|
||||
BaseHeaderType {
|
||||
Layout.fillWidth: true
|
||||
|
||||
headerText: qsTr("DNS servers")
|
||||
|
||||
@@ -40,7 +40,7 @@ PageType {
|
||||
header: ColumnLayout {
|
||||
width: listView.width
|
||||
|
||||
HeaderType {
|
||||
BaseHeaderType {
|
||||
Layout.fillWidth: true
|
||||
Layout.leftMargin: 16
|
||||
Layout.rightMargin: 16
|
||||
|
||||
@@ -71,7 +71,7 @@ PageType {
|
||||
objectName: "backButton"
|
||||
}
|
||||
|
||||
HeaderType {
|
||||
HeaderTypeWithButton {
|
||||
id: headerContent
|
||||
objectName: "headerContent"
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ PageType {
|
||||
id: backButton
|
||||
}
|
||||
|
||||
HeaderType {
|
||||
BaseHeaderType {
|
||||
Layout.fillWidth: true
|
||||
Layout.leftMargin: 16
|
||||
Layout.rightMargin: 16
|
||||
|
||||
@@ -31,7 +31,7 @@ PageType {
|
||||
id: backButton
|
||||
}
|
||||
|
||||
HeaderType {
|
||||
BaseHeaderType {
|
||||
Layout.fillWidth: true
|
||||
Layout.leftMargin: 16
|
||||
Layout.rightMargin: 16
|
||||
|
||||
@@ -94,33 +94,22 @@ PageType {
|
||||
id: backButton
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
HeaderType {
|
||||
enabled: root.pageEnabled
|
||||
HeaderTypeWithSwitcher {
|
||||
Layout.fillWidth: true
|
||||
Layout.leftMargin: 16
|
||||
Layout.rightMargin: 16
|
||||
|
||||
Layout.fillWidth: true
|
||||
Layout.leftMargin: 16
|
||||
|
||||
headerText: qsTr("Split tunneling")
|
||||
}
|
||||
|
||||
SwitcherType {
|
||||
id: switcher
|
||||
|
||||
enabled: root.pageEnabled
|
||||
|
||||
Layout.fillWidth: true
|
||||
Layout.rightMargin: 16
|
||||
|
||||
function onToggledFunc() {
|
||||
SitesModel.toggleSplitTunneling(this.checked)
|
||||
selector.text = root.routeModesModel[getRouteModesModelIndex()].name
|
||||
}
|
||||
headerText: qsTr("Split tunneling")
|
||||
|
||||
enabled: root.pageEnabled
|
||||
showSwitcher: true
|
||||
switcher {
|
||||
checked: SitesModel.isTunnelingEnabled
|
||||
onToggled: { onToggledFunc() }
|
||||
Keys.onEnterPressed: { onToggledFunc() }
|
||||
Keys.onReturnPressed: { onToggledFunc() }
|
||||
enabled: root.pageEnabled
|
||||
}
|
||||
switcherFunction: function(checked) {
|
||||
SitesModel.toggleSplitTunneling(checked)
|
||||
selector.text = root.routeModesModel[getRouteModesModelIndex()].name
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ PageType {
|
||||
Layout.topMargin: 20
|
||||
}
|
||||
|
||||
HeaderType {
|
||||
BaseHeaderType {
|
||||
Layout.fillWidth: true
|
||||
Layout.topMargin: 8
|
||||
Layout.rightMargin: 16
|
||||
|
||||
@@ -28,7 +28,7 @@ PageType {
|
||||
Layout.topMargin: 20
|
||||
}
|
||||
|
||||
HeaderType {
|
||||
BaseHeaderType {
|
||||
Layout.fillWidth: true
|
||||
Layout.topMargin: 8
|
||||
Layout.rightMargin: 16
|
||||
|
||||
@@ -43,7 +43,7 @@ PageType {
|
||||
header: ColumnLayout {
|
||||
width: listView.width
|
||||
|
||||
HeaderType {
|
||||
HeaderTypeWithButton {
|
||||
id: moreButton
|
||||
|
||||
property bool isVisible: SettingsController.getInstallationUuid() !== "" || PageController.isStartPageVisible()
|
||||
@@ -74,7 +74,7 @@ PageType {
|
||||
anchors.right: parent.right
|
||||
spacing: 0
|
||||
|
||||
HeaderType {
|
||||
BaseHeaderType {
|
||||
Layout.fillWidth: true
|
||||
Layout.topMargin: 32
|
||||
Layout.leftMargin: 16
|
||||
|
||||
@@ -66,7 +66,7 @@ PageType {
|
||||
header: ColumnLayout {
|
||||
width: listView.width
|
||||
|
||||
HeaderType {
|
||||
BaseHeaderType {
|
||||
Layout.fillWidth: true
|
||||
Layout.leftMargin: 16
|
||||
Layout.rightMargin: 16
|
||||
|
||||
@@ -59,7 +59,7 @@ PageType {
|
||||
|
||||
spacing: 16
|
||||
|
||||
HeaderType {
|
||||
BaseHeaderType {
|
||||
id: header
|
||||
|
||||
implicitWidth: parent.width
|
||||
|
||||
@@ -118,7 +118,7 @@ PageType {
|
||||
anchors.rightMargin: 16
|
||||
anchors.leftMargin: 16
|
||||
|
||||
HeaderType {
|
||||
BaseHeaderType {
|
||||
Layout.fillWidth: true
|
||||
Layout.topMargin: 20
|
||||
|
||||
|
||||
@@ -96,7 +96,7 @@ PageType {
|
||||
Layout.leftMargin: -16
|
||||
}
|
||||
|
||||
HeaderType {
|
||||
BaseHeaderType {
|
||||
id: header
|
||||
|
||||
Layout.fillWidth: true
|
||||
|
||||
@@ -58,7 +58,7 @@ PageType {
|
||||
header: ColumnLayout {
|
||||
width: listView.width
|
||||
|
||||
HeaderType {
|
||||
BaseHeaderType {
|
||||
id: header
|
||||
|
||||
Layout.fillWidth: true
|
||||
|
||||
@@ -33,7 +33,7 @@ PageType {
|
||||
Layout.topMargin: 20
|
||||
}
|
||||
|
||||
HeaderType {
|
||||
BaseHeaderType {
|
||||
Layout.fillWidth: true
|
||||
Layout.rightMargin: 16
|
||||
Layout.leftMargin: 16
|
||||
|
||||
@@ -61,7 +61,7 @@ PageType {
|
||||
anchors.rightMargin: 16
|
||||
anchors.leftMargin: 16
|
||||
|
||||
HeaderType {
|
||||
BaseHeaderType {
|
||||
headerText: qsTr("New connection")
|
||||
}
|
||||
|
||||
|
||||
@@ -169,7 +169,7 @@ PageType {
|
||||
|
||||
spacing: 0
|
||||
|
||||
HeaderType {
|
||||
HeaderTypeWithButton {
|
||||
id: header
|
||||
Layout.fillWidth: true
|
||||
Layout.topMargin: 24
|
||||
|
||||
@@ -44,7 +44,7 @@ PageType {
|
||||
|
||||
spacing: 0
|
||||
|
||||
HeaderType {
|
||||
BaseHeaderType {
|
||||
Layout.fillWidth: true
|
||||
Layout.topMargin: 24
|
||||
|
||||
|
||||
Reference in New Issue
Block a user