From 5acbdd7af6fc8823d7397a2c9fe6a5019bfdd4b2 Mon Sep 17 00:00:00 2001 From: "vladimir.kuznetsov" Date: Fri, 8 Aug 2025 11:45:20 +0800 Subject: [PATCH] fix: ui fixes after merge with d20ed4a --- .../Pages2/PageProtocolAwgClientSettings.qml | 2 +- .../ui/qml/Pages2/PageProtocolAwgSettings.qml | 2 +- .../qml/Pages2/PageProtocolOpenVpnSettings.qml | 11 +---------- .../Pages2/PageProtocolWireGuardSettings.qml | 4 ---- client/ui/qml/Pages2/PageSettings.qml | 4 ---- client/ui/qml/Pages2/PageSettingsDns.qml | 18 +++++++----------- .../ui/qml/Pages2/PageSettingsServerData.qml | 14 +++++++------- client/ui/qml/Pages2/PageShareFullAccess.qml | 6 ------ 8 files changed, 17 insertions(+), 44 deletions(-) diff --git a/client/ui/qml/Pages2/PageProtocolAwgClientSettings.qml b/client/ui/qml/Pages2/PageProtocolAwgClientSettings.qml index 18db8119b..2db21d495 100644 --- a/client/ui/qml/Pages2/PageProtocolAwgClientSettings.qml +++ b/client/ui/qml/Pages2/PageProtocolAwgClientSettings.qml @@ -34,7 +34,7 @@ PageType { ListViewType { id: listView - anchors.top: backButtonLayout.bottom + anchors.top: backButton.bottom anchors.bottom: saveButton.top anchors.right: parent.right anchors.left: parent.left diff --git a/client/ui/qml/Pages2/PageProtocolAwgSettings.qml b/client/ui/qml/Pages2/PageProtocolAwgSettings.qml index 2140f740d..dcf57a375 100644 --- a/client/ui/qml/Pages2/PageProtocolAwgSettings.qml +++ b/client/ui/qml/Pages2/PageProtocolAwgSettings.qml @@ -37,7 +37,7 @@ PageType { ListViewType { id: listView - anchors.top: backButtonLayout.bottom + anchors.top: backButton.bottom anchors.bottom: parent.bottom anchors.left: parent.left anchors.right: parent.right diff --git a/client/ui/qml/Pages2/PageProtocolOpenVpnSettings.qml b/client/ui/qml/Pages2/PageProtocolOpenVpnSettings.qml index 62cbd1f67..c1a317627 100644 --- a/client/ui/qml/Pages2/PageProtocolOpenVpnSettings.qml +++ b/client/ui/qml/Pages2/PageProtocolOpenVpnSettings.qml @@ -94,8 +94,6 @@ PageType { headerText: qsTr("VPN address subnet") textField.text: subnetAddress - parentFlickable: fl - textField.onEditingFinished: { if (textField.text !== subnetAddress) { subnetAddress = textField.text @@ -138,7 +136,6 @@ PageType { Layout.fillWidth: true Layout.topMargin: 40 - parentFlickable: fl enabled: delegateItem.isEnabled @@ -161,7 +158,6 @@ PageType { Layout.fillWidth: true Layout.topMargin: 24 - parentFlickable: fl text: qsTr("Auto-negotiate encryption") checked: autoNegotiateEncryprion @@ -329,7 +325,6 @@ PageType { id: additionalClientCommandsSwitcher Layout.fillWidth: true Layout.topMargin: 32 - parentFlickable: fl checked: additionalClientCommands !== "" @@ -349,8 +344,6 @@ PageType { visible: additionalClientCommandsSwitcher.checked - parentFlickable: fl - textAreaText: additionalClientCommands placeholderText: qsTr("Commands:") @@ -365,7 +358,6 @@ PageType { id: additionalServerCommandsSwitcher Layout.fillWidth: true Layout.topMargin: 16 - parentFlickable: fl checked: additionalServerCommands !== "" @@ -387,7 +379,7 @@ PageType { textAreaText: additionalServerCommands placeholderText: qsTr("Commands:") - parentFlickable: fl + textArea.onEditingFinished: { if (additionalServerCommands !== textAreaText) { additionalServerCommands = textAreaText @@ -406,7 +398,6 @@ PageType { portTextField.errorText === "" text: qsTr("Save") - parentFlickable: fl onClicked: function() { forceActiveFocus() diff --git a/client/ui/qml/Pages2/PageProtocolWireGuardSettings.qml b/client/ui/qml/Pages2/PageProtocolWireGuardSettings.qml index d8ea1d954..e07e54e34 100644 --- a/client/ui/qml/Pages2/PageProtocolWireGuardSettings.qml +++ b/client/ui/qml/Pages2/PageProtocolWireGuardSettings.qml @@ -66,8 +66,6 @@ PageType { Layout.leftMargin: 16 Layout.rightMargin: 16 - enabled: delegateItem.isEnabled - headerText: qsTr("VPN address subnet") textField.text: subnetAddress @@ -87,8 +85,6 @@ PageType { Layout.leftMargin: 16 Layout.rightMargin: 16 - enabled: delegateItem.isEnabled - headerText: qsTr("Port") textField.text: port textField.maximumLength: 5 diff --git a/client/ui/qml/Pages2/PageSettings.qml b/client/ui/qml/Pages2/PageSettings.qml index f331f9125..de8a00413 100644 --- a/client/ui/qml/Pages2/PageSettings.qml +++ b/client/ui/qml/Pages2/PageSettings.qml @@ -43,8 +43,6 @@ PageType { LabelWithButtonType { Layout.fillWidth: true - Layout.leftMargin: 16 - Layout.rightMargin: 16 visible: isVisible @@ -68,8 +66,6 @@ PageType { visible: GC.isDesktop() Layout.fillWidth: true - Layout.leftMargin: 16 - Layout.rightMargin: 16 text: qsTr("Close application") leftImageSource: "qrc:/images/controls/x-circle.svg" diff --git a/client/ui/qml/Pages2/PageSettingsDns.qml b/client/ui/qml/Pages2/PageSettingsDns.qml index a510f9289..97742590b 100644 --- a/client/ui/qml/Pages2/PageSettingsDns.qml +++ b/client/ui/qml/Pages2/PageSettingsDns.qml @@ -66,6 +66,13 @@ PageType { text: qsTr("If AmneziaDNS is not used or installed") } + } + + model: 1 // fake model to force the ListView to be created without a model + spacing: 16 + + delegate: ColumnLayout { + width: listView.width TextFieldWithHeaderType { id: primaryDns @@ -96,13 +103,6 @@ PageType { regularExpression: InstallController.ipAddressRegExp() } } - } - - model: 1 // fake model to force the ListView to be created without a model - spacing: 16 - - delegate: ColumnLayout { - width: listView.width BasicButtonType { id: restoreDefaultButton @@ -139,10 +139,6 @@ PageType { showQuestionDrawer(headerText, "", yesButtonText, noButtonText, yesButtonFunction, noButtonFunction) } } - } - - footer: ColumnLayout { - width: listView.width BasicButtonType { id: saveButton diff --git a/client/ui/qml/Pages2/PageSettingsServerData.qml b/client/ui/qml/Pages2/PageSettingsServerData.qml index 1a496b5b7..b744a6da8 100644 --- a/client/ui/qml/Pages2/PageSettingsServerData.qml +++ b/client/ui/qml/Pages2/PageSettingsServerData.qml @@ -18,6 +18,8 @@ PageType { signal lastItemTabClickedSignal() + property bool isServerWithWriteAccess: ServersModel.isProcessedServerHasWriteAccess() + Connections { target: InstallController @@ -59,15 +61,13 @@ PageType { target: ServersModel function onProcessedServerIndexChanged() { - listView.isServerWithWriteAccess = ServersModel.isProcessedServerHasWriteAccess() + root.isServerWithWriteAccess = ServersModel.isProcessedServerHasWriteAccess() } } ListViewType { id: listView - property bool isServerWithWriteAccess: ServersModel.isProcessedServerHasWriteAccess() - anchors.fill: parent model: serverActions @@ -107,7 +107,7 @@ PageType { QtObject { id: check - property bool isVisible: true + property bool isVisible: root.isServerWithWriteAccess readonly property string title: qsTr("Check the server for previously installed Amnezia services") readonly property string description: qsTr("Add them to the application if they were not displayed") readonly property var tColor: AmneziaStyle.color.paleGray @@ -121,7 +121,7 @@ PageType { QtObject { id: reboot - property bool isVisible: true + property bool isVisible: root.isServerWithWriteAccess readonly property string title: qsTr("Reboot server") readonly property string description: "" readonly property var tColor: AmneziaStyle.color.vibrantRed @@ -181,7 +181,7 @@ PageType { QtObject { id: clear - property bool isVisible: true + property bool isVisible: root.isServerWithWriteAccess readonly property string title: qsTr("Clear server from Amnezia software") readonly property string description: "" readonly property var tColor: AmneziaStyle.color.vibrantRed @@ -240,7 +240,7 @@ PageType { QtObject { id: switch_to_premium - property bool isVisible: ServersModel.getProcessedServerData("isServerFromTelegramApi") + property bool isVisible: ServersModel.getProcessedServerData("isServerFromTelegramApi") && ServersModel.processedServerIsPremium readonly property string title: qsTr("Switch to the new Amnezia Premium subscription") readonly property string description: "" readonly property var tColor: AmneziaStyle.color.vibrantRed diff --git a/client/ui/qml/Pages2/PageShareFullAccess.qml b/client/ui/qml/Pages2/PageShareFullAccess.qml index 8a6b7a28d..1465459fa 100644 --- a/client/ui/qml/Pages2/PageShareFullAccess.qml +++ b/client/ui/qml/Pages2/PageShareFullAccess.qml @@ -161,10 +161,4 @@ PageType { } } } - - ShareConnectionDrawer { - id: shareConnectionDrawer - - anchors.fill: parent - } }