From 2130131a9db3dcae39f69d573d293c1f1f5c6b10 Mon Sep 17 00:00:00 2001 From: Nethius Date: Tue, 26 Nov 2024 11:41:17 +0700 Subject: [PATCH] bugfix: added scroll on page with services list (#1262) * added scroll on page with services list * fixed margins on PageSetupWizardApiServicesList --- client/ui/qml/Controls2/CardWithIconsType.qml | 1 + .../Pages2/PageSetupWizardApiServicesList.qml | 119 +++++++++--------- .../Pages2/PageSetupWizardConfigSource.qml | 1 - 3 files changed, 60 insertions(+), 61 deletions(-) diff --git a/client/ui/qml/Controls2/CardWithIconsType.qml b/client/ui/qml/Controls2/CardWithIconsType.qml index fea65116..18a29b87 100644 --- a/client/ui/qml/Controls2/CardWithIconsType.qml +++ b/client/ui/qml/Controls2/CardWithIconsType.qml @@ -145,6 +145,7 @@ Button { cursorShape: Qt.PointingHandCursor hoverEnabled: true + enabled: root.enabled onEntered: { backgroundRect.color = root.hoveredColor diff --git a/client/ui/qml/Pages2/PageSetupWizardApiServicesList.qml b/client/ui/qml/Pages2/PageSetupWizardApiServicesList.qml index 85a50393..f726cd49 100644 --- a/client/ui/qml/Pages2/PageSetupWizardApiServicesList.qml +++ b/client/ui/qml/Pages2/PageSetupWizardApiServicesList.qml @@ -16,83 +16,82 @@ PageType { defaultActiveFocusItem: focusItem - FlickableType { - id: fl + ColumnLayout { + id: header + anchors.top: parent.top - anchors.bottom: parent.bottom - contentHeight: content.height + anchors.left: parent.left + anchors.right: parent.right - ColumnLayout { - id: content + spacing: 0 - anchors.top: parent.top - anchors.left: parent.left - anchors.right: parent.right + Item { + id: focusItem + KeyNavigation.tab: backButton + } - spacing: 0 - - Item { - id: focusItem - KeyNavigation.tab: backButton - } - - BackButtonType { - id: backButton - Layout.topMargin: 20 + BackButtonType { + id: backButton + Layout.topMargin: 20 // KeyNavigation.tab: fileButton.rightButton - } + } - HeaderType { - Layout.fillWidth: true - Layout.topMargin: 8 - Layout.rightMargin: 16 - Layout.leftMargin: 16 - Layout.bottomMargin: 32 + HeaderType { + Layout.fillWidth: true + Layout.topMargin: 8 + Layout.rightMargin: 16 + Layout.leftMargin: 16 + Layout.bottomMargin: 16 - headerText: qsTr("VPN by Amnezia") - descriptionText: qsTr("Choose a VPN service that suits your needs.") - } + headerText: qsTr("VPN by Amnezia") + descriptionText: qsTr("Choose a VPN service that suits your needs.") + } + } - ListView { - id: containers - width: parent.width - height: containers.contentItem.height - spacing: 16 + ListView { + id: servicesListView + anchors.top: header.bottom + anchors.right: parent.right + anchors.left: parent.left + anchors.bottom: parent.bottom + anchors.topMargin: 16 + spacing: 0 - currentIndex: 1 - interactive: false - model: ApiServicesModel + currentIndex: 1 + clip: true + model: ApiServicesModel - delegate: Item { - implicitWidth: containers.width - implicitHeight: delegateContent.implicitHeight + ScrollBar.vertical: ScrollBar {} - ColumnLayout { - id: delegateContent + delegate: Item { + implicitWidth: servicesListView.width + implicitHeight: delegateContent.implicitHeight - anchors.top: parent.top - anchors.left: parent.left - anchors.right: parent.right + ColumnLayout { + id: delegateContent - CardWithIconsType { - id: card + anchors.fill: parent - Layout.fillWidth: true - Layout.rightMargin: 16 - Layout.leftMargin: 16 + CardWithIconsType { + id: card - headerText: name - bodyText: cardDescription - footerText: price + Layout.fillWidth: true + Layout.rightMargin: 16 + Layout.leftMargin: 16 + Layout.bottomMargin: 16 - rightImageSource: "qrc:/images/controls/chevron-right.svg" + headerText: name + bodyText: cardDescription + footerText: price - onClicked: { - if (isServiceAvailable) { - ApiServicesModel.setServiceIndex(index) - PageController.goToPage(PageEnum.PageSetupWizardApiServiceInfo) - } - } + rightImageSource: "qrc:/images/controls/chevron-right.svg" + + enabled: isServiceAvailable + + onClicked: { + if (isServiceAvailable) { + ApiServicesModel.setServiceIndex(index) + PageController.goToPage(PageEnum.PageSetupWizardApiServiceInfo) } } } diff --git a/client/ui/qml/Pages2/PageSetupWizardConfigSource.qml b/client/ui/qml/Pages2/PageSetupWizardConfigSource.qml index 7c031997..f973c89c 100644 --- a/client/ui/qml/Pages2/PageSetupWizardConfigSource.qml +++ b/client/ui/qml/Pages2/PageSetupWizardConfigSource.qml @@ -47,7 +47,6 @@ PageType { KeyNavigation.tab: textKey.textField } - HeaderType { property bool isVisible: SettingsController.getInstallationUuid() !== "" || PageController.isStartPageVisible()