replace FlickableType with ListViewType in PageSetupWizardTextKey

This commit is contained in:
Cyril Anisimov
2025-07-26 16:05:46 +02:00
parent 9817ad6daf
commit ca224b22fa
+36 -20
View File
@@ -13,25 +13,31 @@ import "../Config"
PageType { PageType {
id: root id: root
FlickableType { BackButtonType {
id: fl id: backButton
anchors.top: parent.top
anchors.bottom: parent.bottom
contentHeight: content.height
ColumnLayout {
id: content
anchors.top: parent.top anchors.top: parent.top
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
anchors.topMargin: 20
spacing: 16 onFocusChanged: {
if (this.activeFocus) {
BackButtonType { listView.positionViewAtBeginning()
id: backButton
Layout.topMargin: 20
} }
}
}
ListViewType {
id: listView
anchors.top: backButton.bottom
anchors.bottom: parent.bottom
anchors.right: parent.right
anchors.left: parent.left
header: ColumnLayout {
width: listView.width
BaseHeaderType { BaseHeaderType {
Layout.fillWidth: true Layout.fillWidth: true
@@ -41,6 +47,13 @@ PageType {
headerText: qsTr("Connection key") headerText: qsTr("Connection key")
descriptionText: qsTr("A line that starts with vpn://...") descriptionText: qsTr("A line that starts with vpn://...")
} }
}
spacing: 16
model: 1 // fake model to force the ListView to be created without a model
delegate: ColumnLayout {
width: listView.width
TextFieldWithHeaderType { TextFieldWithHeaderType {
id: textKey id: textKey
@@ -60,17 +73,18 @@ PageType {
} }
} }
} }
}
footer: ColumnLayout {
width: listView.width
BasicButtonType { BasicButtonType {
id: continueButton id: continueButton
anchors.bottom: parent.bottom Layout.fillWidth: true
anchors.left: parent.left Layout.rightMargin: 16
anchors.right: parent.right Layout.leftMargin: 16
anchors.rightMargin: 16 Layout.topMargin: 16
anchors.leftMargin: 16 Layout.bottomMargin: 32
anchors.bottomMargin: 32
text: qsTr("Continue") text: qsTr("Continue")
@@ -81,3 +95,5 @@ PageType {
} }
} }
} }
}
}