replace FlickableType and ListView with

`ListViewType`
This commit is contained in:
Cyril Anisimov 2025-04-13 20:05:22 +02:00
parent a2d30efaab
commit 7d187bf881
58 changed files with 6221 additions and 6762 deletions

View file

@ -46,27 +46,29 @@ PageType {
}
}
FlickableType {
id: fl
ListViewType {
id: listView
anchors.top: backButton.bottom
anchors.bottom: parent.bottom
contentHeight: content.implicitHeight + connectButton.implicitHeight
anchors.right: parent.right
anchors.left: parent.left
ColumnLayout {
id: content
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
anchors.rightMargin: 16
anchors.leftMargin: 16
header: ColumnLayout {
width: listView.width
BaseHeaderType {
Layout.leftMargin: 16
Layout.rightMargin: 16
headerText: qsTr("New connection")
}
RowLayout {
Layout.topMargin: 32
Layout.leftMargin: 16
Layout.rightMargin: 16
spacing: 8
visible: fileName.text !== ""
@ -88,7 +90,9 @@ PageType {
BasicButtonType {
id: showContentButton
Layout.topMargin: 16
Layout.leftMargin: -8
Layout.leftMargin: 16
Layout.rightMargin: 16
implicitHeight: 32
defaultColor: AmneziaStyle.color.transparent
@ -99,8 +103,6 @@ PageType {
text: showContent ? qsTr("Collapse content") : qsTr("Show content")
parentFlickable: fl
clickedFunc: function() {
showContent = !showContent
}
@ -112,12 +114,23 @@ PageType {
visible: ImportController.isNativeWireGuardConfig()
Layout.fillWidth: true
Layout.leftMargin: 16
Layout.rightMargin: 16
text: qsTr("Enable WireGuard obfuscation. It may be useful if WireGuard is blocked on your provider.")
}
}
model: 1 // fake model to force the ListView to be created without a model
delegate: ColumnLayout {
width: listView.width
WarningType {
Layout.topMargin: 16
Layout.fillWidth: true
Layout.topMargin: 16
Layout.leftMargin: 16
Layout.rightMargin: 16
textString: ImportController.getMaliciousWarningText()
textFormat: Qt.RichText
@ -130,17 +143,25 @@ PageType {
}
WarningType {
Layout.topMargin: 16
Layout.fillWidth: true
Layout.topMargin: 16
Layout.leftMargin: 16
Layout.rightMargin: 16
textString: qsTr("Use connection codes only from sources you trust. Codes from public sources may have been created to intercept your data.")
iconPath: "qrc:/images/controls/alert-circle.svg"
}
}
footer: ColumnLayout {
width: listView.width
Rectangle {
Layout.fillWidth: true
Layout.bottomMargin: 48
Layout.rightMargin: 16
Layout.leftMargin: 16
implicitHeight: configContent.implicitHeight
@ -153,42 +174,29 @@ PageType {
id: configContent
anchors.fill: parent
anchors.margins: 16
wrapMode: Text.Wrap
text: ImportController.getConfig()
}
}
}
}
Rectangle {
anchors.fill: columnContent
anchors.bottomMargin: -24
color: AmneziaStyle.color.midnightBlack
opacity: 0.8
}
BasicButtonType {
id: connectButton
ColumnLayout {
id: columnContent
anchors.bottom: parent.bottom
anchors.left: parent.left
anchors.right: parent.right
anchors.rightMargin: 16
anchors.leftMargin: 16
Layout.fillWidth: true
Layout.topMargin: 16
Layout.bottomMargin: 32
Layout.rightMargin: 16
Layout.leftMargin: 16
BasicButtonType {
id: connectButton
Layout.fillWidth: true
Layout.bottomMargin: 32
text: qsTr("Connect")
clickedFunc: function() {
if (cloakingCheckBox.checked) {
ImportController.processNativeWireGuardConfig()
text: qsTr("Connect")
clickedFunc: function() {
if (cloakingCheckBox.checked) {
ImportController.processNativeWireGuardConfig()
}
ImportController.importConfig()
}
ImportController.importConfig()
}
}
}