From 1ecbd2dc92f4a927ea25e1d3b7fc7971b195c0fc Mon Sep 17 00:00:00 2001 From: Cyril Anisimov Date: Sat, 26 Jul 2025 17:44:06 +0200 Subject: [PATCH] update `SettingsContainersListView` --- .../Components/SettingsContainersListView.qml | 98 ++++++++----------- 1 file changed, 42 insertions(+), 56 deletions(-) diff --git a/client/ui/qml/Components/SettingsContainersListView.qml b/client/ui/qml/Components/SettingsContainersListView.qml index 4b551cbb3..ccf609179 100644 --- a/client/ui/qml/Components/SettingsContainersListView.qml +++ b/client/ui/qml/Components/SettingsContainersListView.qml @@ -16,75 +16,61 @@ import "../Controls2/TextTypes" ListViewType { id: root - width: parent.width - height: root.contentItem.height + anchors.fill: parent - clip: true - reuseItems: true + delegate: ColumnLayout { + width: root.width - property bool isFocusable: false + LabelWithButtonType { + Layout.fillWidth: true - delegate: Item { - implicitWidth: root.width - implicitHeight: delegateContent.implicitHeight + text: name + descriptionText: description + rightImageSource: isInstalled ? "qrc:/images/controls/chevron-right.svg" : "qrc:/images/controls/download.svg" - ColumnLayout { - id: delegateContent + clickedFunction: function() { + if (isInstalled) { + var containerIndex = root.model.mapToSource(index) + ContainersModel.setProcessedContainerIndex(containerIndex) - anchors.fill: parent - - LabelWithButtonType { - id: containerRadioButton - implicitWidth: parent.width - - text: name - descriptionText: description - rightImageSource: isInstalled ? "qrc:/images/controls/chevron-right.svg" : "qrc:/images/controls/download.svg" - - clickedFunction: function() { - if (isInstalled) { - var containerIndex = root.model.mapToSource(index) - ContainersModel.setProcessedContainerIndex(containerIndex) - - if (serviceType !== ProtocolEnum.Other) { - if (config[ContainerProps.containerTypeToString(containerIndex)]["isThirdPartyConfig"]) { - ProtocolsModel.updateModel(config) - PageController.goToPage(PageEnum.PageProtocolRaw) - return - } - } - - switch (containerIndex) { - case ContainerEnum.Ipsec: { + if (serviceType !== ProtocolEnum.Other) { + if (config[ContainerProps.containerTypeToString(containerIndex)]["isThirdPartyConfig"]) { ProtocolsModel.updateModel(config) PageController.goToPage(PageEnum.PageProtocolRaw) - break + return } - case ContainerEnum.Dns: { - PageController.goToPage(PageEnum.PageServiceDnsSettings) - break - } - default: { - ProtocolsModel.updateModel(config) - PageController.goToPage(PageEnum.PageSettingsServerProtocol) - } - } - - } else { - ContainersModel.setProcessedContainerIndex(root.model.mapToSource(index)) - InstallController.setShouldCreateServer(false) - PageController.goToPage(PageEnum.PageSetupWizardProtocolSettings) } - } - MouseArea { - anchors.fill: parent - cursorShape: Qt.PointingHandCursor - enabled: false + switch (containerIndex) { + case ContainerEnum.Ipsec: { + ProtocolsModel.updateModel(config) + PageController.goToPage(PageEnum.PageProtocolRaw) + break + } + case ContainerEnum.Dns: { + PageController.goToPage(PageEnum.PageServiceDnsSettings) + break + } + default: { + ProtocolsModel.updateModel(config) + PageController.goToPage(PageEnum.PageSettingsServerProtocol) + } + } + + } else { + ContainersModel.setProcessedContainerIndex(root.model.mapToSource(index)) + InstallController.setShouldCreateServer(false) + PageController.goToPage(PageEnum.PageSetupWizardProtocolSettings) } } - DividerType {} + MouseArea { + anchors.fill: parent + cursorShape: Qt.PointingHandCursor + enabled: false + } } + + DividerType {} } }