Files
amnezia-client/client/ui/qml/Pages2/PageSetupWizardApiServicesList.qml
T

92 lines
2.1 KiB
QML
Raw Normal View History

import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import QtQuick.Dialogs
import PageEnum 1.0
import Style 1.0
import "./"
import "../Controls2"
import "../Controls2/TextTypes"
import "../Config"
PageType {
id: root
2025-07-29 22:06:12 +02:00
BackButtonType {
id: backButton
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
2025-07-29 22:06:12 +02:00
Layout.topMargin: 20
2025-07-29 22:06:12 +02:00
onActiveFocusChanged: {
if(backButton.enabled && backButton.activeFocus) {
listView.positionViewAtBeginning()
}
}
}
2025-07-26 15:39:47 +02:00
ListViewType {
2025-07-29 22:06:12 +02:00
id: listView
2024-12-31 04:16:52 +01:00
2025-07-29 22:06:12 +02:00
anchors.top: backButton.bottom
anchors.right: parent.right
anchors.left: parent.left
anchors.bottom: parent.bottom
anchors.topMargin: 16
2025-07-26 15:39:47 +02:00
header: ColumnLayout {
width: listView.width
2024-12-31 04:16:52 +01:00
2025-07-26 15:39:47 +02:00
BaseHeaderType {
Layout.fillWidth: true
Layout.rightMargin: 16
Layout.leftMargin: 16
Layout.bottomMargin: 24
headerText: qsTr("VPN by Amnezia")
descriptionText: qsTr("Choose a VPN service that suits your needs.")
}
}
2025-07-26 15:39:47 +02:00
spacing: 0
2025-07-26 15:39:47 +02:00
model: ApiServicesModel
2025-07-26 15:39:47 +02:00
delegate: ColumnLayout {
2024-12-31 04:16:52 +01:00
2025-07-26 15:39:47 +02:00
width: listView.width
2025-07-26 15:39:47 +02:00
enabled: isServiceAvailable
2025-07-26 15:39:47 +02:00
CardWithIconsType {
id: card
2025-07-26 15:39:47 +02:00
Layout.fillWidth: true
Layout.rightMargin: 16
Layout.leftMargin: 16
Layout.bottomMargin: 16
2025-07-26 15:39:47 +02:00
headerText: name
bodyText: cardDescription
footerText: price
2025-07-26 15:39:47 +02:00
rightImageSource: "qrc:/images/controls/chevron-right.svg"
2025-07-26 15:39:47 +02:00
onClicked: {
if (isServiceAvailable) {
ApiServicesModel.setServiceIndex(index)
PageController.goToPage(PageEnum.PageSetupWizardApiServiceInfo)
}
}
2025-07-26 15:39:47 +02:00
Keys.onEnterPressed: clicked()
Keys.onReturnPressed: clicked()
}
}
}
}