From ca233be1277b098185aad2fb1e65b04335fdedfc Mon Sep 17 00:00:00 2001 From: pokamest Date: Thu, 21 Oct 2021 19:49:53 +0300 Subject: [PATCH] QML ui fixes --- client/ui/qml/Controls/BackButton.qml | 33 ++++++++-- client/ui/qml/Controls/Logo.qml | 3 - client/ui/qml/Pages/PageAppSetting.qml | 17 +++--- client/ui/qml/Pages/PageNetworkSetting.qml | 70 ++++++++++++---------- client/ui/qml/Pages/PageServerSettings.qml | 23 ++++--- client/ui/qml/Pages/PageVPN.qml | 6 +- 6 files changed, 87 insertions(+), 65 deletions(-) diff --git a/client/ui/qml/Controls/BackButton.qml b/client/ui/qml/Controls/BackButton.qml index 45423b6b..5395a21e 100644 --- a/client/ui/qml/Controls/BackButton.qml +++ b/client/ui/qml/Controls/BackButton.qml @@ -1,10 +1,33 @@ -ImageButtonType { +import QtQuick 2.12 +import QtQuick.Controls 2.12 + +Button { + id: root x: 10 - y: 10 - width: 26 - height: 20 - icon.source: "qrc:/images/arrow_left.png" + y: 5 + width: 41 + height: 35 + + hoverEnabled: true + property bool containsMouse: hovered + + background: Item {} + + MouseArea { + id: mouseArea + anchors.fill: parent + enabled: false + cursorShape: Qt.PointingHandCursor + } + onClicked: { UiLogic.closePage() } + + contentItem: Image { + id: img + source: "qrc:/images/arrow_left.png" + anchors.fill: root + anchors.margins: root.containsMouse ? 9 : 10 + } } diff --git a/client/ui/qml/Controls/Logo.qml b/client/ui/qml/Controls/Logo.qml index 28e17892..9368002c 100644 --- a/client/ui/qml/Controls/Logo.qml +++ b/client/ui/qml/Controls/Logo.qml @@ -4,8 +4,5 @@ import QtQuick.Controls 2.12 Image { anchors.horizontalCenter: parent.horizontalCenter anchors.bottomMargin: 30 -// width: GC.trW(150) -// height: GC.trH(22) -// y: GC.trY(590) source: "qrc:/images/AmneziaVPN.png" } diff --git a/client/ui/qml/Pages/PageAppSetting.qml b/client/ui/qml/Pages/PageAppSetting.qml index 4fd0e2ff..8be9274c 100644 --- a/client/ui/qml/Pages/PageAppSetting.qml +++ b/client/ui/qml/Pages/PageAppSetting.qml @@ -52,13 +52,6 @@ PageBase { AppSettingsLogic.onCheckBoxStartMinimizedToggled(checked) } } - Image { - anchors.horizontalCenter: root.horizontalCenter - width: GC.trW(150) - height: GC.trH(22) - y: GC.trY(590) - source: "qrc:/images/AmneziaVPN.png" - } LabelType { x: 30 y: 240 @@ -69,7 +62,8 @@ PageBase { BlueButtonType { x: 30 y: 280 - width: 321 + anchors.horizontalCenter: parent.horizontalCenter + width: parent.width - 40 height: 41 text: qsTr("Check for updates") onClicked: { @@ -79,11 +73,16 @@ PageBase { BlueButtonType { x: 30 y: 340 - width: 321 + anchors.horizontalCenter: parent.horizontalCenter + width: parent.width - 40 height: 41 text: qsTr("Open logs folder") onClicked: { AppSettingsLogic.onPushButtonOpenLogsClicked() } } + + Logo { + anchors.bottom: parent.bottom + } } diff --git a/client/ui/qml/Pages/PageNetworkSetting.qml b/client/ui/qml/Pages/PageNetworkSetting.qml index c2c2b075..7de7ca5f 100644 --- a/client/ui/qml/Pages/PageNetworkSetting.qml +++ b/client/ui/qml/Pages/PageNetworkSetting.qml @@ -14,34 +14,22 @@ PageBase { id: back } Caption { + id: caption text: qsTr("DNS Servers") } - Image { - anchors.horizontalCenter: root.horizontalCenter - width: GC.trW(150) - height: GC.trH(22) - y: GC.trY(590) - source: "qrc:/images/AmneziaVPN.png" - } LabelType { + id: l1 x: 40 - y: 95 - width: 291 + anchors.top: caption.bottom + width: parent.width - 40 height: 21 text: qsTr("Primary DNS server") } - LabelType { - x: 40 - y: 175 - width: 291 - height: 21 - text: qsTr("Secondray DNS server") - } TextFieldType { id: dns1 x: 40 - y: 120 - width: 271 + anchors.top: l1.bottom + width: parent.width - 90 height: 40 text: NetworkSettingsLogic.lineEditDns1Text onEditingFinished: { @@ -52,11 +40,33 @@ PageBase { regExp: NetworkSettingsLogic.ipAddressValidatorRegex } } + ImageButtonType { + id: resetDNS1 + anchors. left: dns1.right + anchors.leftMargin: 10 + anchors.verticalCenter: dns1.verticalCenter + width: 24 + height: 24 + icon.source: "qrc:/images/reload.png" + onClicked: { + NetworkSettingsLogic.onPushButtonResetDns1Clicked() + } + } + + LabelType { + id: l2 + x: 40 + anchors.top: dns1.bottom + anchors.topMargin: 20 + width: parent.width - 40 + height: 21 + text: qsTr("Secondray DNS server") + } TextFieldType { id: dns2 x: 40 - y: 200 - width: 271 + anchors.top: l2.bottom + width: parent.width - 90 height: 40 text: NetworkSettingsLogic.lineEditDns2Text onEditingFinished: { @@ -67,21 +77,11 @@ PageBase { regExp: NetworkSettingsLogic.ipAddressValidatorRegex } } - ImageButtonType { - id: resetDNS1 - x: 320 - y: 127 - width: 24 - height: 24 - icon.source: "qrc:/images/reload.png" - onClicked: { - NetworkSettingsLogic.onPushButtonResetDns1Clicked() - } - } ImageButtonType { id: resetDNS2 - x: 320 - y: 207 + anchors. left: dns2.right + anchors.leftMargin: 10 + anchors.verticalCenter: dns2.verticalCenter width: 24 height: 24 icon.source: "qrc:/images/reload.png" @@ -89,4 +89,8 @@ PageBase { NetworkSettingsLogic.onPushButtonResetDns2Clicked() } } + + Logo { + anchors.bottom: parent.bottom + } } diff --git a/client/ui/qml/Pages/PageServerSettings.qml b/client/ui/qml/Pages/PageServerSettings.qml index de138d3e..465d1348 100644 --- a/client/ui/qml/Pages/PageServerSettings.qml +++ b/client/ui/qml/Pages/PageServerSettings.qml @@ -19,15 +19,8 @@ PageBase { text: qsTr("Server settings") anchors.horizontalCenter: parent.horizontalCenter } - Image { - anchors.horizontalCenter: root.horizontalCenter - width: GC.trW(150) - height: GC.trH(22) - y: GC.trY(590) - source: "qrc:/images/AmneziaVPN.png" - } LabelType { - x: 20 + anchors.horizontalCenter: parent.horizontalCenter y: 150 width: 341 height: 31 @@ -66,7 +59,7 @@ PageBase { BlueButtonType { anchors.horizontalCenter: parent.horizontalCenter y: 410 - width: 300 + width: parent.width - 40 height: 40 text: ServerSettingsLogic.pushButtonClearText visible: ServerSettingsLogic.pushButtonClearVisible @@ -77,7 +70,7 @@ PageBase { BlueButtonType { anchors.horizontalCenter: parent.horizontalCenter y: 350 - width: 300 + width: parent.width - 40 height: 40 text: ServerSettingsLogic.pushButtonClearClientCacheText visible: ServerSettingsLogic.pushButtonClearClientCacheVisible @@ -88,7 +81,7 @@ PageBase { BlueButtonType { anchors.horizontalCenter: parent.horizontalCenter y: 470 - width: 300 + width: parent.width - 40 height: 40 text: qsTr("Forget this server") onClicked: { @@ -98,7 +91,7 @@ PageBase { BlueButtonType { anchors.horizontalCenter: parent.horizontalCenter y: 210 - width: 300 + width: parent.width - 40 height: 40 text: qsTr("Protocols and Services") onClicked: { @@ -108,7 +101,7 @@ PageBase { BlueButtonType { anchors.horizontalCenter: parent.horizontalCenter y: 260 - width: 300 + width: parent.width - 40 height: 40 text: qsTr("Share Server (FULL ACCESS)") visible: ServerSettingsLogic.pushButtonShareFullVisible @@ -116,4 +109,8 @@ PageBase { ServerSettingsLogic.onPushButtonShareFullClicked() } } + + Logo { + anchors.bottom: parent.bottom + } } diff --git a/client/ui/qml/Pages/PageVPN.qml b/client/ui/qml/Pages/PageVPN.qml index 9239b3f3..7e20824a 100644 --- a/client/ui/qml/Pages/PageVPN.qml +++ b/client/ui/qml/Pages/PageVPN.qml @@ -143,11 +143,12 @@ PageBase { Text { id: conn_type_label + visible: !GC.isMobile() x: 20 anchors.bottom: conn_type_group.top anchors.bottomMargin: 10 width: 281 - height: 21 + height: GC.isMobile() ? 0: 21 font.family: "Lato" font.styleName: "normal" font.pixelSize: 15 @@ -161,9 +162,10 @@ PageBase { Item { id: conn_type_group x: 20 + visible: !GC.isMobile() anchors.bottom: button_add_site.top width: 351 - height: 91 + height: GC.isMobile() ? 0: 91 enabled: VpnLogic.widgetVpnModeEnabled RadioButtonType { x: 0