bugfix: added scroll on page with services list (#1262)

* added scroll on page with services list

* fixed margins on PageSetupWizardApiServicesList
This commit is contained in:
Nethius 2024-11-26 11:41:17 +07:00 committed by GitHub
parent e0b091b474
commit 2130131a9d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 60 additions and 61 deletions

View file

@ -145,6 +145,7 @@ Button {
cursorShape: Qt.PointingHandCursor cursorShape: Qt.PointingHandCursor
hoverEnabled: true hoverEnabled: true
enabled: root.enabled
onEntered: { onEntered: {
backgroundRect.color = root.hoveredColor backgroundRect.color = root.hoveredColor

View file

@ -16,83 +16,82 @@ PageType {
defaultActiveFocusItem: focusItem defaultActiveFocusItem: focusItem
FlickableType { ColumnLayout {
id: fl id: header
anchors.top: parent.top anchors.top: parent.top
anchors.bottom: parent.bottom anchors.left: parent.left
contentHeight: content.height anchors.right: parent.right
ColumnLayout { spacing: 0
id: content
anchors.top: parent.top Item {
anchors.left: parent.left id: focusItem
anchors.right: parent.right KeyNavigation.tab: backButton
}
spacing: 0 BackButtonType {
id: backButton
Item { Layout.topMargin: 20
id: focusItem
KeyNavigation.tab: backButton
}
BackButtonType {
id: backButton
Layout.topMargin: 20
// KeyNavigation.tab: fileButton.rightButton // KeyNavigation.tab: fileButton.rightButton
} }
HeaderType { HeaderType {
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: 8 Layout.topMargin: 8
Layout.rightMargin: 16 Layout.rightMargin: 16
Layout.leftMargin: 16 Layout.leftMargin: 16
Layout.bottomMargin: 32 Layout.bottomMargin: 16
headerText: qsTr("VPN by Amnezia") headerText: qsTr("VPN by Amnezia")
descriptionText: qsTr("Choose a VPN service that suits your needs.") descriptionText: qsTr("Choose a VPN service that suits your needs.")
} }
}
ListView { ListView {
id: containers id: servicesListView
width: parent.width anchors.top: header.bottom
height: containers.contentItem.height anchors.right: parent.right
spacing: 16 anchors.left: parent.left
anchors.bottom: parent.bottom
anchors.topMargin: 16
spacing: 0
currentIndex: 1 currentIndex: 1
interactive: false clip: true
model: ApiServicesModel model: ApiServicesModel
delegate: Item { ScrollBar.vertical: ScrollBar {}
implicitWidth: containers.width
implicitHeight: delegateContent.implicitHeight
ColumnLayout { delegate: Item {
id: delegateContent implicitWidth: servicesListView.width
implicitHeight: delegateContent.implicitHeight
anchors.top: parent.top ColumnLayout {
anchors.left: parent.left id: delegateContent
anchors.right: parent.right
CardWithIconsType { anchors.fill: parent
id: card
Layout.fillWidth: true CardWithIconsType {
Layout.rightMargin: 16 id: card
Layout.leftMargin: 16
headerText: name Layout.fillWidth: true
bodyText: cardDescription Layout.rightMargin: 16
footerText: price Layout.leftMargin: 16
Layout.bottomMargin: 16
rightImageSource: "qrc:/images/controls/chevron-right.svg" headerText: name
bodyText: cardDescription
footerText: price
onClicked: { rightImageSource: "qrc:/images/controls/chevron-right.svg"
if (isServiceAvailable) {
ApiServicesModel.setServiceIndex(index) enabled: isServiceAvailable
PageController.goToPage(PageEnum.PageSetupWizardApiServiceInfo)
} onClicked: {
} if (isServiceAvailable) {
ApiServicesModel.setServiceIndex(index)
PageController.goToPage(PageEnum.PageSetupWizardApiServiceInfo)
} }
} }
} }

View file

@ -47,7 +47,6 @@ PageType {
KeyNavigation.tab: textKey.textField KeyNavigation.tab: textKey.textField
} }
HeaderType { HeaderType {
property bool isVisible: SettingsController.getInstallationUuid() !== "" || PageController.isStartPageVisible() property bool isVisible: SettingsController.getInstallationUuid() !== "" || PageController.isStartPageVisible()