From 23700ed9143640c028c0a7118e02b5522859b518 Mon Sep 17 00:00:00 2001 From: Cyril Anisimov Date: Sat, 26 Jul 2025 15:23:45 +0200 Subject: [PATCH] replace `FlickableType` with `ListViewType` in `PageServiceTorWebsiteSettings` --- .../Pages2/PageServiceTorWebsiteSettings.qml | 50 +++++++++++-------- 1 file changed, 28 insertions(+), 22 deletions(-) diff --git a/client/ui/qml/Pages2/PageServiceTorWebsiteSettings.qml b/client/ui/qml/Pages2/PageServiceTorWebsiteSettings.qml index 200beeb83..1ea1f8147 100644 --- a/client/ui/qml/Pages2/PageServiceTorWebsiteSettings.qml +++ b/client/ui/qml/Pages2/PageServiceTorWebsiteSettings.qml @@ -25,34 +25,31 @@ PageType { } } - ColumnLayout { - id: backButtonLayout + BackButtonType { + id: backButton anchors.top: parent.top anchors.left: parent.left anchors.right: parent.right - anchors.topMargin: 20 - - BackButtonType { - id: backButton + + onFocusChanged: { + if (this.activeFocus) { + listView.positionViewAtBeginning() + } } } - FlickableType { - id: fl - anchors.top: backButtonLayout.bottom + ListViewType { + id: listView + + anchors.top: backButton.bottom anchors.bottom: parent.bottom - contentHeight: content.implicitHeight + anchors.right: parent.right + anchors.left: parent.left - ColumnLayout { - id: content - - anchors.top: parent.top - anchors.left: parent.left - anchors.right: parent.right - - spacing: 0 + header: ColumnLayout { + width: listView.width BaseHeaderType { Layout.fillWidth: true @@ -61,11 +58,19 @@ PageType { headerText: qsTr("Tor website settings") } + } + + model: 1 // fake model to force the ListView to be created without a model + + delegate: ColumnLayout { // TODO(CyAn84): add DelegateChooser after migrate to 6.9 + width: listView.width LabelWithButtonType { id: websiteName + Layout.fillWidth: true Layout.topMargin: 32 + Layout.bottomMargin: 24 text: qsTr("Website address") descriptionText: { @@ -83,15 +88,16 @@ PageType { clickedFunction: function() { GC.copyToClipBoard(descriptionText) PageController.showNotificationMessage(qsTr("Copied")) - if (!GC.isMobile()) { - this.rightButton.forceActiveFocus() - } } } + } + + footer: ColumnLayout { + width: listView.width ParagraphTextType { Layout.fillWidth: true - Layout.topMargin: 40 + Layout.topMargin: 16 Layout.leftMargin: 16 Layout.rightMargin: 16