Refactor: Replace HeaderType with new Types for headers in QML pages
This commit is contained in:
parent
13127cd64c
commit
1c2b1f1e0f
43 changed files with 68 additions and 86 deletions
|
|
@ -56,7 +56,7 @@ PageType {
|
||||||
anchors.rightMargin: 16
|
anchors.rightMargin: 16
|
||||||
anchors.leftMargin: 16
|
anchors.leftMargin: 16
|
||||||
|
|
||||||
HeaderType {
|
BaseHeaderType {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.topMargin: 20
|
Layout.topMargin: 20
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,7 @@ PageType {
|
||||||
header: ColumnLayout {
|
header: ColumnLayout {
|
||||||
width: listView.width
|
width: listView.width
|
||||||
|
|
||||||
HeaderType {
|
BaseHeaderType {
|
||||||
id: header
|
id: header
|
||||||
|
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
|
|
|
||||||
|
|
@ -91,7 +91,7 @@ PageType {
|
||||||
|
|
||||||
spacing: 0
|
spacing: 0
|
||||||
|
|
||||||
HeaderType {
|
BaseHeaderType {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
|
|
||||||
headerText: qsTr("AmneziaWG settings")
|
headerText: qsTr("AmneziaWG settings")
|
||||||
|
|
|
||||||
|
|
@ -91,7 +91,7 @@ PageType {
|
||||||
|
|
||||||
spacing: 0
|
spacing: 0
|
||||||
|
|
||||||
HeaderType {
|
BaseHeaderType {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
|
|
||||||
headerText: qsTr("AmneziaWG settings")
|
headerText: qsTr("AmneziaWG settings")
|
||||||
|
|
|
||||||
|
|
@ -76,7 +76,7 @@ PageType {
|
||||||
|
|
||||||
spacing: 0
|
spacing: 0
|
||||||
|
|
||||||
HeaderType {
|
BaseHeaderType {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
|
|
||||||
headerText: qsTr("Cloak settings")
|
headerText: qsTr("Cloak settings")
|
||||||
|
|
|
||||||
|
|
@ -75,7 +75,7 @@ PageType {
|
||||||
|
|
||||||
spacing: 0
|
spacing: 0
|
||||||
|
|
||||||
HeaderType {
|
BaseHeaderType {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
|
|
||||||
headerText: qsTr("OpenVPN settings")
|
headerText: qsTr("OpenVPN settings")
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ PageType {
|
||||||
id: backButton
|
id: backButton
|
||||||
}
|
}
|
||||||
|
|
||||||
HeaderType {
|
BaseHeaderType {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.leftMargin: 16
|
Layout.leftMargin: 16
|
||||||
Layout.rightMargin: 16
|
Layout.rightMargin: 16
|
||||||
|
|
|
||||||
|
|
@ -78,7 +78,7 @@ PageType {
|
||||||
|
|
||||||
spacing: 0
|
spacing: 0
|
||||||
|
|
||||||
HeaderType {
|
BaseHeaderType {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
|
|
||||||
headerText: qsTr("Shadowsocks settings")
|
headerText: qsTr("Shadowsocks settings")
|
||||||
|
|
|
||||||
|
|
@ -85,7 +85,7 @@ PageType {
|
||||||
|
|
||||||
spacing: 0
|
spacing: 0
|
||||||
|
|
||||||
HeaderType {
|
BaseHeaderType {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
|
|
||||||
headerText: qsTr("WG settings")
|
headerText: qsTr("WG settings")
|
||||||
|
|
|
||||||
|
|
@ -77,7 +77,7 @@ PageType {
|
||||||
|
|
||||||
spacing: 0
|
spacing: 0
|
||||||
|
|
||||||
HeaderType {
|
BaseHeaderType {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
headerText: qsTr("WG settings")
|
headerText: qsTr("WG settings")
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -75,7 +75,7 @@ PageType {
|
||||||
|
|
||||||
spacing: 0
|
spacing: 0
|
||||||
|
|
||||||
HeaderType {
|
BaseHeaderType {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
headerText: qsTr("XRay settings")
|
headerText: qsTr("XRay settings")
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,7 @@ PageType {
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
|
|
||||||
HeaderType {
|
BaseHeaderType {
|
||||||
id: header
|
id: header
|
||||||
|
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
|
|
|
||||||
|
|
@ -85,7 +85,7 @@ PageType {
|
||||||
|
|
||||||
spacing: 0
|
spacing: 0
|
||||||
|
|
||||||
HeaderType {
|
BaseHeaderType {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.leftMargin: 16
|
Layout.leftMargin: 16
|
||||||
Layout.rightMargin: 16
|
Layout.rightMargin: 16
|
||||||
|
|
|
||||||
|
|
@ -77,7 +77,7 @@ PageType {
|
||||||
|
|
||||||
spacing: 0
|
spacing: 0
|
||||||
|
|
||||||
HeaderType {
|
BaseHeaderType {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.leftMargin: 16
|
Layout.leftMargin: 16
|
||||||
Layout.rightMargin: 16
|
Layout.rightMargin: 16
|
||||||
|
|
@ -217,7 +217,7 @@ PageType {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
HeaderType {
|
BaseHeaderType {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
|
|
||||||
headerText: qsTr("SOCKS5 settings")
|
headerText: qsTr("SOCKS5 settings")
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,7 @@ PageType {
|
||||||
|
|
||||||
spacing: 0
|
spacing: 0
|
||||||
|
|
||||||
HeaderType {
|
BaseHeaderType {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.leftMargin: 16
|
Layout.leftMargin: 16
|
||||||
Layout.rightMargin: 16
|
Layout.rightMargin: 16
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ PageType {
|
||||||
|
|
||||||
spacing: 0
|
spacing: 0
|
||||||
|
|
||||||
HeaderType {
|
BaseHeaderType {
|
||||||
id: header
|
id: header
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.topMargin: 24
|
Layout.topMargin: 24
|
||||||
|
|
|
||||||
|
|
@ -69,7 +69,7 @@ PageType {
|
||||||
Layout.topMargin: 20
|
Layout.topMargin: 20
|
||||||
}
|
}
|
||||||
|
|
||||||
HeaderType {
|
HeaderTypeWithButton {
|
||||||
id: headerContent
|
id: headerContent
|
||||||
objectName: "headerContent"
|
objectName: "headerContent"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -91,7 +91,7 @@ PageType {
|
||||||
id: backButton
|
id: backButton
|
||||||
}
|
}
|
||||||
|
|
||||||
HeaderType {
|
BaseHeaderType {
|
||||||
id: header
|
id: header
|
||||||
|
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,7 @@ PageType {
|
||||||
id: backButton
|
id: backButton
|
||||||
}
|
}
|
||||||
|
|
||||||
HeaderType {
|
BaseHeaderType {
|
||||||
id: header
|
id: header
|
||||||
|
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
|
|
|
||||||
|
|
@ -93,7 +93,7 @@ PageType {
|
||||||
Layout.topMargin: 20
|
Layout.topMargin: 20
|
||||||
}
|
}
|
||||||
|
|
||||||
HeaderType {
|
HeaderTypeWithButton {
|
||||||
id: headerContent
|
id: headerContent
|
||||||
objectName: "headerContent"
|
objectName: "headerContent"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@ PageType {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
HeaderType {
|
BaseHeaderType {
|
||||||
id: header
|
id: header
|
||||||
|
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
|
|
|
||||||
|
|
@ -79,29 +79,22 @@ PageType {
|
||||||
id: backButton
|
id: backButton
|
||||||
}
|
}
|
||||||
|
|
||||||
RowLayout {
|
HeaderTypeWithSwitcher {
|
||||||
HeaderType {
|
Layout.fillWidth: true
|
||||||
Layout.fillWidth: true
|
Layout.leftMargin: 16
|
||||||
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
|
enabled: root.pageEnabled
|
||||||
}
|
}
|
||||||
|
switcherFunction: function(checked) {
|
||||||
SwitcherType {
|
AppSplitTunnelingModel.toggleSplitTunneling(checked)
|
||||||
id: switcher
|
selector.text = root.routeModesModel[getRouteModesModelIndex()].name
|
||||||
|
|
||||||
Layout.fillWidth: true
|
|
||||||
Layout.rightMargin: 16
|
|
||||||
|
|
||||||
enabled: root.pageEnabled
|
|
||||||
|
|
||||||
checked: AppSplitTunnelingModel.isTunnelingEnabled
|
|
||||||
onToggled: {
|
|
||||||
AppSplitTunnelingModel.toggleSplitTunneling(checked)
|
|
||||||
selector.text = root.routeModesModel[getRouteModesModelIndex()].name
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,7 @@ PageType {
|
||||||
|
|
||||||
spacing: 0
|
spacing: 0
|
||||||
|
|
||||||
HeaderType {
|
BaseHeaderType {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.leftMargin: 16
|
Layout.leftMargin: 16
|
||||||
Layout.rightMargin: 16
|
Layout.rightMargin: 16
|
||||||
|
|
|
||||||
|
|
@ -60,7 +60,7 @@ PageType {
|
||||||
|
|
||||||
spacing: 16
|
spacing: 16
|
||||||
|
|
||||||
HeaderType {
|
BaseHeaderType {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
|
|
||||||
headerText: qsTr("Back up your configuration")
|
headerText: qsTr("Back up your configuration")
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@ PageType {
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
|
|
||||||
HeaderType {
|
BaseHeaderType {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.leftMargin: 16
|
Layout.leftMargin: 16
|
||||||
Layout.rightMargin: 16
|
Layout.rightMargin: 16
|
||||||
|
|
|
||||||
|
|
@ -50,7 +50,7 @@ PageType {
|
||||||
|
|
||||||
spacing: 16
|
spacing: 16
|
||||||
|
|
||||||
HeaderType {
|
BaseHeaderType {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
|
|
||||||
headerText: qsTr("DNS servers")
|
headerText: qsTr("DNS servers")
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,7 @@ PageType {
|
||||||
header: ColumnLayout {
|
header: ColumnLayout {
|
||||||
width: listView.width
|
width: listView.width
|
||||||
|
|
||||||
HeaderType {
|
BaseHeaderType {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.leftMargin: 16
|
Layout.leftMargin: 16
|
||||||
Layout.rightMargin: 16
|
Layout.rightMargin: 16
|
||||||
|
|
|
||||||
|
|
@ -71,7 +71,7 @@ PageType {
|
||||||
objectName: "backButton"
|
objectName: "backButton"
|
||||||
}
|
}
|
||||||
|
|
||||||
HeaderType {
|
HeaderTypeWithButton {
|
||||||
id: headerContent
|
id: headerContent
|
||||||
objectName: "headerContent"
|
objectName: "headerContent"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ PageType {
|
||||||
id: backButton
|
id: backButton
|
||||||
}
|
}
|
||||||
|
|
||||||
HeaderType {
|
BaseHeaderType {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.leftMargin: 16
|
Layout.leftMargin: 16
|
||||||
Layout.rightMargin: 16
|
Layout.rightMargin: 16
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@ PageType {
|
||||||
id: backButton
|
id: backButton
|
||||||
}
|
}
|
||||||
|
|
||||||
HeaderType {
|
BaseHeaderType {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.leftMargin: 16
|
Layout.leftMargin: 16
|
||||||
Layout.rightMargin: 16
|
Layout.rightMargin: 16
|
||||||
|
|
|
||||||
|
|
@ -94,33 +94,22 @@ PageType {
|
||||||
id: backButton
|
id: backButton
|
||||||
}
|
}
|
||||||
|
|
||||||
RowLayout {
|
HeaderTypeWithSwitcher {
|
||||||
HeaderType {
|
Layout.fillWidth: true
|
||||||
enabled: root.pageEnabled
|
Layout.leftMargin: 16
|
||||||
|
Layout.rightMargin: 16
|
||||||
|
|
||||||
Layout.fillWidth: true
|
headerText: qsTr("Split tunneling")
|
||||||
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
|
|
||||||
}
|
|
||||||
|
|
||||||
|
enabled: root.pageEnabled
|
||||||
|
showSwitcher: true
|
||||||
|
switcher {
|
||||||
checked: SitesModel.isTunnelingEnabled
|
checked: SitesModel.isTunnelingEnabled
|
||||||
onToggled: { onToggledFunc() }
|
enabled: root.pageEnabled
|
||||||
Keys.onEnterPressed: { onToggledFunc() }
|
}
|
||||||
Keys.onReturnPressed: { onToggledFunc() }
|
switcherFunction: function(checked) {
|
||||||
|
SitesModel.toggleSplitTunneling(checked)
|
||||||
|
selector.text = root.routeModesModel[getRouteModesModelIndex()].name
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@ PageType {
|
||||||
Layout.topMargin: 20
|
Layout.topMargin: 20
|
||||||
}
|
}
|
||||||
|
|
||||||
HeaderType {
|
BaseHeaderType {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.topMargin: 8
|
Layout.topMargin: 8
|
||||||
Layout.rightMargin: 16
|
Layout.rightMargin: 16
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ PageType {
|
||||||
Layout.topMargin: 20
|
Layout.topMargin: 20
|
||||||
}
|
}
|
||||||
|
|
||||||
HeaderType {
|
BaseHeaderType {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.topMargin: 8
|
Layout.topMargin: 8
|
||||||
Layout.rightMargin: 16
|
Layout.rightMargin: 16
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,7 @@ PageType {
|
||||||
header: ColumnLayout {
|
header: ColumnLayout {
|
||||||
width: listView.width
|
width: listView.width
|
||||||
|
|
||||||
HeaderType {
|
HeaderTypeWithButton {
|
||||||
id: moreButton
|
id: moreButton
|
||||||
|
|
||||||
property bool isVisible: SettingsController.getInstallationUuid() !== "" || PageController.isStartPageVisible()
|
property bool isVisible: SettingsController.getInstallationUuid() !== "" || PageController.isStartPageVisible()
|
||||||
|
|
@ -74,7 +74,7 @@ PageType {
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
spacing: 0
|
spacing: 0
|
||||||
|
|
||||||
HeaderType {
|
BaseHeaderType {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.topMargin: 32
|
Layout.topMargin: 32
|
||||||
Layout.leftMargin: 16
|
Layout.leftMargin: 16
|
||||||
|
|
|
||||||
|
|
@ -66,7 +66,7 @@ PageType {
|
||||||
header: ColumnLayout {
|
header: ColumnLayout {
|
||||||
width: listView.width
|
width: listView.width
|
||||||
|
|
||||||
HeaderType {
|
BaseHeaderType {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.leftMargin: 16
|
Layout.leftMargin: 16
|
||||||
Layout.rightMargin: 16
|
Layout.rightMargin: 16
|
||||||
|
|
|
||||||
|
|
@ -59,7 +59,7 @@ PageType {
|
||||||
|
|
||||||
spacing: 16
|
spacing: 16
|
||||||
|
|
||||||
HeaderType {
|
BaseHeaderType {
|
||||||
id: header
|
id: header
|
||||||
|
|
||||||
implicitWidth: parent.width
|
implicitWidth: parent.width
|
||||||
|
|
|
||||||
|
|
@ -118,7 +118,7 @@ PageType {
|
||||||
anchors.rightMargin: 16
|
anchors.rightMargin: 16
|
||||||
anchors.leftMargin: 16
|
anchors.leftMargin: 16
|
||||||
|
|
||||||
HeaderType {
|
BaseHeaderType {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.topMargin: 20
|
Layout.topMargin: 20
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -96,7 +96,7 @@ PageType {
|
||||||
Layout.leftMargin: -16
|
Layout.leftMargin: -16
|
||||||
}
|
}
|
||||||
|
|
||||||
HeaderType {
|
BaseHeaderType {
|
||||||
id: header
|
id: header
|
||||||
|
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
|
|
|
||||||
|
|
@ -58,7 +58,7 @@ PageType {
|
||||||
header: ColumnLayout {
|
header: ColumnLayout {
|
||||||
width: listView.width
|
width: listView.width
|
||||||
|
|
||||||
HeaderType {
|
BaseHeaderType {
|
||||||
id: header
|
id: header
|
||||||
|
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@ PageType {
|
||||||
Layout.topMargin: 20
|
Layout.topMargin: 20
|
||||||
}
|
}
|
||||||
|
|
||||||
HeaderType {
|
BaseHeaderType {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.rightMargin: 16
|
Layout.rightMargin: 16
|
||||||
Layout.leftMargin: 16
|
Layout.leftMargin: 16
|
||||||
|
|
|
||||||
|
|
@ -61,7 +61,7 @@ PageType {
|
||||||
anchors.rightMargin: 16
|
anchors.rightMargin: 16
|
||||||
anchors.leftMargin: 16
|
anchors.leftMargin: 16
|
||||||
|
|
||||||
HeaderType {
|
BaseHeaderType {
|
||||||
headerText: qsTr("New connection")
|
headerText: qsTr("New connection")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -169,7 +169,7 @@ PageType {
|
||||||
|
|
||||||
spacing: 0
|
spacing: 0
|
||||||
|
|
||||||
HeaderType {
|
HeaderTypeWithButton {
|
||||||
id: header
|
id: header
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.topMargin: 24
|
Layout.topMargin: 24
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,7 @@ PageType {
|
||||||
|
|
||||||
spacing: 0
|
spacing: 0
|
||||||
|
|
||||||
HeaderType {
|
BaseHeaderType {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.topMargin: 24
|
Layout.topMargin: 24
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue