replace Flickable with ListViewType in drawer in PageSettingsApiNativeConfigs

This commit is contained in:
Cyril Anisimov
2025-07-26 12:42:58 +02:00
parent 62770f4c04
commit b0fb3491ca
@@ -22,22 +22,34 @@ PageType {
property string configExtension: ".conf"
property string configCaption: qsTr("Save AmneziaVPN config")
BackButtonType {
id: backButton
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
anchors.topMargin: 20
onActiveFocusChanged: {
if(backButton.enabled && backButton.activeFocus) {
listView.positionViewAtBeginning()
}
}
}
ListViewType {
id: listView
anchors.fill: parent
anchors.topMargin: 20
anchors.bottomMargin: 24
anchors.top: backButton.bottom
anchors.bottom: parent.bottom
anchors.right: parent.right
anchors.left: parent.left
model: ApiCountryModel
header: ColumnLayout {
width: listView.width
BackButtonType {
id: backButton
}
BaseHeaderType {
id: header
@@ -104,30 +116,34 @@ PageType {
}
}
FlickableType {
ListViewType {
id: drawerListView
anchors.top: moreOptionsDrawerBackButton.bottom
anchors.left: parent.left
anchors.right: parent.right
anchors.bottom: parent.bottom
contentHeight: moreOptionsDrawerContent.height
ColumnLayout {
id: moreOptionsDrawerContent
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
header: ColumnLayout {
width: drawerListView.width
Header2Type {
Layout.fillWidth: true
Layout.margins: 16
headerText: moreOptionsDrawer.countryName + qsTr(" configuration file")
}
}
model: 1 // fake model to force the ListView to be created without a model
delegate: ColumnLayout {
width: drawerListView.width
LabelWithButtonType {
Layout.fillWidth: true
Layout.leftMargin: 16
Layout.rightMargin: 16
text: qsTr("Generate a new configuration file")
descriptionText: qsTr("The previously created one will stop working")
@@ -138,9 +154,16 @@ PageType {
}
DividerType {}
}
footer: ColumnLayout {
width: drawerListView.width
LabelWithButtonType {
Layout.fillWidth: true
Layout.leftMargin: 16
Layout.rightMargin: 16
text: qsTr("Revoke the current configuration file")
clickedFunction: function() {
@@ -212,8 +235,7 @@ PageType {
}
moreOptionsDrawer.closeTriggered()
}
var noButtonFunction = function() {
}
var noButtonFunction = function() {}
showQuestionDrawer(headerText, descriptionText, yesButtonText, noButtonText, yesButtonFunction, noButtonFunction)
}