diff --git a/client/images/background_connected.png b/client/images/background_connected.png index 7e83c851..62480d5f 100644 Binary files a/client/images/background_connected.png and b/client/images/background_connected.png differ diff --git a/client/images/background_connected@2x.png b/client/images/background_connected@2x.png new file mode 100644 index 00000000..4f76b956 Binary files /dev/null and b/client/images/background_connected@2x.png differ diff --git a/client/images/line.png b/client/images/line.png deleted file mode 100644 index c5a3a466..00000000 Binary files a/client/images/line.png and /dev/null differ diff --git a/client/images/min.png b/client/images/min.png deleted file mode 100644 index cacc4fec..00000000 Binary files a/client/images/min.png and /dev/null differ diff --git a/client/resources.qrc b/client/resources.qrc index b4a36f09..7955a8f1 100644 --- a/client/resources.qrc +++ b/client/resources.qrc @@ -3,7 +3,6 @@ translations/amneziavpn_ru.qm images/close.png images/settings.png - images/min.png images/favorites_disabled.png images/favorites_enabled.png images/favorites_hover.png @@ -30,11 +29,9 @@ fonts/Lato-Thin.ttf fonts/Lato-ThinItalic.ttf images/AmneziaVPN.png - images/line.png images/server_settings.png images/share.png server_scripts/remove_container.sh - images/background_connected.png server_scripts/setup_host_firewall.sh images/reload.png server_scripts/openvpn_cloak/Dockerfile @@ -68,40 +65,43 @@ server_scripts/wireguard/start.sh server_scripts/wireguard/template.conf ui/qml/main.qml - ui/qml/GlobalConfig.qml - ui/qml/qmldir ui/qml/TitleBar.qml - ui/qml/PageStart.qml - ui/qml/TextFieldType.qml - ui/qml/LabelType.qml - ui/qml/BasicButtonType.qml - ui/qml/ImageButtonType.qml - ui/qml/PageNewServer.qml - ui/qml/BlueButtonType.qml - ui/qml/PageSetupWizard.qml - ui/qml/RadioButtonType.qml - ui/qml/PageSetupWizardHighLevel.qml - ui/qml/PageSetupWizardVPNMode.qml - ui/qml/CheckBoxType.qml - ui/qml/PageSetupWizardMediumLevel.qml - ui/qml/PageSetupWizardLowLevel.qml - ui/qml/PageNewServerConfiguring.qml - ui/qml/PageNewServerProtocol.qml - ui/qml/ComboBoxType.qml - ui/qml/PageVPN.qml - ui/qml/PageSites.qml - ui/qml/PageGeneralSettings.qml - ui/qml/SettingButtonType.qml - ui/qml/PageServer.qml - ui/qml/PageAppSetting.qml - ui/qml/PageNetworkSetting.qml - ui/qml/PageServerSetting.qml - ui/qml/PageServerProtocols.qml - ui/qml/PageShareConnection.qml - ui/qml/PageProtoOpenVPN.qml - ui/qml/PageProtoShadowSock.qml - ui/qml/PageProtoCloak.qml - ui/qml/ShareConnectionContent.qml - ui/qml/ShareConnectionButtonType.qml + ui/qml/Pages/PageAppSetting.qml + ui/qml/Pages/PageGeneralSettings.qml + ui/qml/Pages/PageNetworkSetting.qml + ui/qml/Pages/PageNewServer.qml + ui/qml/Pages/PageNewServerConfiguring.qml + ui/qml/Pages/PageNewServerProtocol.qml + ui/qml/Pages/PageProtoCloak.qml + ui/qml/Pages/PageProtoOpenVPN.qml + ui/qml/Pages/PageProtoShadowSock.qml + ui/qml/Pages/PageServer.qml + ui/qml/Pages/PageServerProtocols.qml + ui/qml/Pages/PageServerSetting.qml + ui/qml/Pages/PageSetupWizard.qml + ui/qml/Pages/PageSetupWizardHighLevel.qml + ui/qml/Pages/PageSetupWizardLowLevel.qml + ui/qml/Pages/PageSetupWizardMediumLevel.qml + ui/qml/Pages/PageSetupWizardVPNMode.qml + ui/qml/Pages/PageShareConnection.qml + ui/qml/Pages/PageSites.qml + ui/qml/Pages/PageStart.qml + ui/qml/Pages/PageVPN.qml + ui/qml/Controls/BasicButtonType.qml + ui/qml/Controls/BlueButtonType.qml + ui/qml/Controls/CheckBoxType.qml + ui/qml/Controls/ComboBoxType.qml + ui/qml/Controls/ImageButtonType.qml + ui/qml/Controls/LabelType.qml + ui/qml/Controls/RadioButtonType.qml + ui/qml/Controls/SettingButtonType.qml + ui/qml/Controls/ShareConnectionButtonType.qml + ui/qml/Controls/ShareConnectionContent.qml + ui/qml/Controls/TextFieldType.qml + ui/qml/Pages/PageBase.qml + ui/qml/Config/GlobalConfig.qml + ui/qml/Config/qmldir + images/background_connected.png + images/background_connected@2x.png diff --git a/client/ui/qml/GlobalConfig.qml b/client/ui/qml/Config/GlobalConfig.qml similarity index 100% rename from client/ui/qml/GlobalConfig.qml rename to client/ui/qml/Config/GlobalConfig.qml diff --git a/client/ui/qml/qmldir b/client/ui/qml/Config/qmldir similarity index 100% rename from client/ui/qml/qmldir rename to client/ui/qml/Config/qmldir diff --git a/client/ui/qml/BasicButtonType.qml b/client/ui/qml/Controls/BasicButtonType.qml similarity index 100% rename from client/ui/qml/BasicButtonType.qml rename to client/ui/qml/Controls/BasicButtonType.qml diff --git a/client/ui/qml/BlueButtonType.qml b/client/ui/qml/Controls/BlueButtonType.qml similarity index 100% rename from client/ui/qml/BlueButtonType.qml rename to client/ui/qml/Controls/BlueButtonType.qml diff --git a/client/ui/qml/CheckBoxType.qml b/client/ui/qml/Controls/CheckBoxType.qml similarity index 100% rename from client/ui/qml/CheckBoxType.qml rename to client/ui/qml/Controls/CheckBoxType.qml diff --git a/client/ui/qml/ComboBoxType.qml b/client/ui/qml/Controls/ComboBoxType.qml similarity index 100% rename from client/ui/qml/ComboBoxType.qml rename to client/ui/qml/Controls/ComboBoxType.qml diff --git a/client/ui/qml/ImageButtonType.qml b/client/ui/qml/Controls/ImageButtonType.qml similarity index 100% rename from client/ui/qml/ImageButtonType.qml rename to client/ui/qml/Controls/ImageButtonType.qml diff --git a/client/ui/qml/LabelType.qml b/client/ui/qml/Controls/LabelType.qml similarity index 100% rename from client/ui/qml/LabelType.qml rename to client/ui/qml/Controls/LabelType.qml diff --git a/client/ui/qml/Controls/RadioButtonType.qml b/client/ui/qml/Controls/RadioButtonType.qml new file mode 100644 index 00000000..119cf794 --- /dev/null +++ b/client/ui/qml/Controls/RadioButtonType.qml @@ -0,0 +1,36 @@ +import QtQuick 2.12 +import QtQuick.Controls 2.12 + +RadioButton { + id: root + + indicator: Rectangle { + implicitWidth: 13 + implicitHeight: 13 + x: root.leftPadding + y: parent.height / 2 - height / 2 + radius: 13 + border.color: root.down ? "#777777" : "#777777" + + Rectangle { + width: 7 + height: 7 + x: 3 + y: 3 + radius: 4 + color: root.down ? "#15CDCB" : "#15CDCB" + visible: root.checked + } + } + + contentItem: Text { + text: root.text + font.family: "Lato" + font.styleName: "normal" + font.pixelSize: 16 + color: "#181922" + verticalAlignment: Text.AlignVCenter + leftPadding: root.indicator.width + root.spacing + } + height: 10 +} diff --git a/client/ui/qml/SettingButtonType.qml b/client/ui/qml/Controls/SettingButtonType.qml similarity index 100% rename from client/ui/qml/SettingButtonType.qml rename to client/ui/qml/Controls/SettingButtonType.qml diff --git a/client/ui/qml/ShareConnectionButtonType.qml b/client/ui/qml/Controls/ShareConnectionButtonType.qml similarity index 100% rename from client/ui/qml/ShareConnectionButtonType.qml rename to client/ui/qml/Controls/ShareConnectionButtonType.qml diff --git a/client/ui/qml/ShareConnectionContent.qml b/client/ui/qml/Controls/ShareConnectionContent.qml similarity index 100% rename from client/ui/qml/ShareConnectionContent.qml rename to client/ui/qml/Controls/ShareConnectionContent.qml diff --git a/client/ui/qml/TextFieldType.qml b/client/ui/qml/Controls/TextFieldType.qml similarity index 100% rename from client/ui/qml/TextFieldType.qml rename to client/ui/qml/Controls/TextFieldType.qml diff --git a/client/ui/qml/PageAppSetting.qml b/client/ui/qml/Pages/PageAppSetting.qml similarity index 97% rename from client/ui/qml/PageAppSetting.qml rename to client/ui/qml/Pages/PageAppSetting.qml index 80c027db..6b70bf90 100644 --- a/client/ui/qml/PageAppSetting.qml +++ b/client/ui/qml/Pages/PageAppSetting.qml @@ -1,11 +1,11 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 import "./" +import "../Controls" +import "../Config" -Item { +PageBase { id: root - width: GC.screenWidth - height: GC.screenHeight ImageButtonType { id: back x: 10 diff --git a/client/ui/qml/Pages/PageBase.qml b/client/ui/qml/Pages/PageBase.qml new file mode 100644 index 00000000..2544f944 --- /dev/null +++ b/client/ui/qml/Pages/PageBase.qml @@ -0,0 +1,13 @@ +import QtQuick 2.12 +import QtQuick.Controls 2.12 +import "./" +import "../Controls" +import "../Config" + +Item { + id: root +// width: GC.screenWidth +// height: GC.screenHeight + + anchors.fill: parent +} diff --git a/client/ui/qml/PageGeneralSettings.qml b/client/ui/qml/Pages/PageGeneralSettings.qml similarity index 73% rename from client/ui/qml/PageGeneralSettings.qml rename to client/ui/qml/Pages/PageGeneralSettings.qml index ee37a050..7ae6d254 100644 --- a/client/ui/qml/PageGeneralSettings.qml +++ b/client/ui/qml/Pages/PageGeneralSettings.qml @@ -2,11 +2,11 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 import PageEnum 1.0 import "./" +import "../Controls" +import "../Config" Item { id: root - width: GC.screenWidth - height: GC.screenHeight ImageButtonType { id: back x: 10 @@ -18,69 +18,56 @@ Item { UiLogic.closePage() } } - Image { - x: 10 - y: 160 - width: 360 - height: 1 - source: "qrc:/images/line.png" - } - Image { - x: 10 - y: 220 - width: 360 - height: 1 - source: "qrc:/images/line.png" - } - Image { - x: 10 - y: 620 - width: 360 - height: 1 - source: "qrc:/images/line.png" - } - Image { - x: 10 - y: 560 - width: 360 - height: 1 - source: "qrc:/images/line.png" - } - Image { - x: 10 - y: 280 - width: 360 - height: 1 - source: "qrc:/images/line.png" - } - Image { - x: 10 - y: 100 - width: 360 - height: 1 - source: "qrc:/images/line.png" - } - Image { - x: 10 - y: 340 - width: 360 - height: 1 - source: "qrc:/images/line.png" - } - Image { - x: 10 - y: 400 - width: 360 - height: 1 - source: "qrc:/images/line.png" - } - Image { - x: 10 + Rectangle { y: 40 - width: 360 + x: 20 + width: parent.width - 40 height: 1 - source: "qrc:/images/line.png" + color: "#DDDDDD" } + Rectangle { + y: 100 + x: 20 + width: parent.width - 40 + height: 1 + color: "#DDDDDD" + } + Rectangle { + y: 160 + x: 20 + width: parent.width - 40 + height: 1 + color: "#DDDDDD" + } + Rectangle { + y: 220 + x: 20 + width: parent.width - 40 + height: 1 + color: "#DDDDDD" + } + Rectangle { + y: 280 + x: 20 + width: parent.width - 40 + height: 1 + color: "#DDDDDD" + } + Rectangle { + y: 340 + x: 20 + width: parent.width - 40 + height: 1 + color: "#DDDDDD" + } + Rectangle { + y: 400 + x: 20 + width: parent.width - 40 + height: 1 + color: "#DDDDDD" + } + SettingButtonType { x: 30 y: 355 @@ -103,17 +90,6 @@ Item { UiLogic.goToPage(PageEnum.AppSettings) } } - SettingButtonType { - x: 30 - y: 575 - width: 330 - height: 30 - icon.source: "qrc:/images/settings.png" - text: qsTr("Exit") - onClicked: { - Qt.quit() - } - } SettingButtonType { x: 30 y: 115 @@ -159,4 +135,16 @@ Item { UiLogic.onPushButtonGeneralSettingsShareConnectionClicked() } } + SettingButtonType { + x: 30 + anchors.bottom: parent.bottom + anchors.bottomMargin: 20 + width: 330 + height: 30 + icon.source: "qrc:/images/settings.png" + text: qsTr("Exit") + onClicked: { + Qt.quit() + } + } } diff --git a/client/ui/qml/PageNetworkSetting.qml b/client/ui/qml/Pages/PageNetworkSetting.qml similarity index 97% rename from client/ui/qml/PageNetworkSetting.qml rename to client/ui/qml/Pages/PageNetworkSetting.qml index 5fe9afbf..88cc93ef 100644 --- a/client/ui/qml/PageNetworkSetting.qml +++ b/client/ui/qml/Pages/PageNetworkSetting.qml @@ -1,11 +1,11 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 import "./" +import "../Controls" +import "../Config" Item { id: root - width: GC.screenWidth - height: GC.screenHeight ImageButtonType { id: back x: 10 diff --git a/client/ui/qml/PageNewServer.qml b/client/ui/qml/Pages/PageNewServer.qml similarity index 97% rename from client/ui/qml/PageNewServer.qml rename to client/ui/qml/Pages/PageNewServer.qml index e903fda1..29cd1bf9 100644 --- a/client/ui/qml/PageNewServer.qml +++ b/client/ui/qml/Pages/PageNewServer.qml @@ -2,11 +2,11 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 import PageEnum 1.0 import "./" +import "../Controls" +import "../Config" Item { id: root - width: GC.screenWidth - height: GC.screenHeight Text { font.family: "Lato" font.styleName: "normal" diff --git a/client/ui/qml/PageNewServerConfiguring.qml b/client/ui/qml/Pages/PageNewServerConfiguring.qml similarity index 97% rename from client/ui/qml/PageNewServerConfiguring.qml rename to client/ui/qml/Pages/PageNewServerConfiguring.qml index bb35b7ba..4b681aa4 100644 --- a/client/ui/qml/PageNewServerConfiguring.qml +++ b/client/ui/qml/Pages/PageNewServerConfiguring.qml @@ -1,11 +1,11 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 import "./" +import "../Controls" +import "../Config" Item { id: root - width: GC.screenWidth - height: GC.screenHeight enabled: UiLogic.pageNewServerConfiguringEnabled Text { font.family: "Lato" diff --git a/client/ui/qml/PageNewServerProtocol.qml b/client/ui/qml/Pages/PageNewServerProtocol.qml similarity index 99% rename from client/ui/qml/PageNewServerProtocol.qml rename to client/ui/qml/Pages/PageNewServerProtocol.qml index dff27153..fb85e11b 100644 --- a/client/ui/qml/PageNewServerProtocol.qml +++ b/client/ui/qml/Pages/PageNewServerProtocol.qml @@ -1,11 +1,11 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 import "./" +import "../Controls" +import "../Config" Item { id: root - width: GC.screenWidth - height: GC.screenHeight ImageButtonType { id: back x: 10 diff --git a/client/ui/qml/PageProtoCloak.qml b/client/ui/qml/Pages/PageProtoCloak.qml similarity index 98% rename from client/ui/qml/PageProtoCloak.qml rename to client/ui/qml/Pages/PageProtoCloak.qml index 1404b7ed..0f9f59c8 100644 --- a/client/ui/qml/PageProtoCloak.qml +++ b/client/ui/qml/Pages/PageProtoCloak.qml @@ -1,11 +1,11 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 import "./" +import "../Controls" +import "../Config" Item { id: root - width: GC.screenWidth - height: GC.screenHeight enabled: UiLogic.pageProtoCloakEnabled ImageButtonType { id: back diff --git a/client/ui/qml/PageProtoOpenVPN.qml b/client/ui/qml/Pages/PageProtoOpenVPN.qml similarity index 99% rename from client/ui/qml/PageProtoOpenVPN.qml rename to client/ui/qml/Pages/PageProtoOpenVPN.qml index 19096778..ca777a7e 100644 --- a/client/ui/qml/PageProtoOpenVPN.qml +++ b/client/ui/qml/Pages/PageProtoOpenVPN.qml @@ -1,11 +1,11 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 import "./" +import "../Controls" +import "../Config" Item { id: root - width: GC.screenWidth - height: GC.screenHeight enabled: UiLogic.pageProtoOpenvpnEnabled ImageButtonType { id: back diff --git a/client/ui/qml/PageProtoShadowSock.qml b/client/ui/qml/Pages/PageProtoShadowSock.qml similarity index 98% rename from client/ui/qml/PageProtoShadowSock.qml rename to client/ui/qml/Pages/PageProtoShadowSock.qml index 04ba59e0..255cda5a 100644 --- a/client/ui/qml/PageProtoShadowSock.qml +++ b/client/ui/qml/Pages/PageProtoShadowSock.qml @@ -1,11 +1,11 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 import "./" +import "../Controls" +import "../Config" Item { id: root - width: GC.screenWidth - height: GC.screenHeight enabled: UiLogic.pageProtoShadowsocksEnabled ImageButtonType { id: back diff --git a/client/ui/qml/PageServer.qml b/client/ui/qml/Pages/PageServer.qml similarity index 98% rename from client/ui/qml/PageServer.qml rename to client/ui/qml/Pages/PageServer.qml index 818317c1..c8febe14 100644 --- a/client/ui/qml/PageServer.qml +++ b/client/ui/qml/Pages/PageServer.qml @@ -1,13 +1,13 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 -import "./" import QtGraphicalEffects 1.12 import PageEnum 1.0 +import "../Controls" +import "./" +import "../Config" Item { id: root - width: GC.screenWidth - height: GC.screenHeight ImageButtonType { id: back x: 10 diff --git a/client/ui/qml/PageServerProtocols.qml b/client/ui/qml/Pages/PageServerProtocols.qml similarity index 99% rename from client/ui/qml/PageServerProtocols.qml rename to client/ui/qml/Pages/PageServerProtocols.qml index 81f3c290..90b66828 100644 --- a/client/ui/qml/PageServerProtocols.qml +++ b/client/ui/qml/Pages/PageServerProtocols.qml @@ -1,11 +1,11 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 import "./" +import "../Controls" +import "../Config" Item { id: root - width: GC.screenWidth - height: GC.screenHeight enabled: UiLogic.pageServerProtocolsEnabled ImageButtonType { id: back diff --git a/client/ui/qml/PageServerSetting.qml b/client/ui/qml/Pages/PageServerSetting.qml similarity index 94% rename from client/ui/qml/PageServerSetting.qml rename to client/ui/qml/Pages/PageServerSetting.qml index 6a09fcc3..df5b0a94 100644 --- a/client/ui/qml/PageServerSetting.qml +++ b/client/ui/qml/Pages/PageServerSetting.qml @@ -1,12 +1,12 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 -import "./" import PageEnum 1.0 +import "./" +import "../Controls" +import "../Config" Item { id: root - width: GC.screenWidth - height: GC.screenHeight enabled: UiLogic.pageServerSettingsEnabled ImageButtonType { @@ -28,7 +28,7 @@ Item { horizontalAlignment: Text.AlignHCenter verticalAlignment: Text.AlignVCenter text: qsTr("Server settings") - x: 10 + anchors.horizontalCenter: parent.horizontalCenter y: 35 width: 361 height: 31 @@ -50,7 +50,7 @@ Item { text: UiLogic.labelServerSettingsCurrentVpnProtocolText } LabelType { - x: 20 + anchors.horizontalCenter: parent.horizontalCenter y: 120 width: 341 height: 31 @@ -59,7 +59,7 @@ Item { text: UiLogic.labelServerSettingsServerText } LabelType { - x: 40 + anchors.horizontalCenter: parent.horizontalCenter y: 530 width: 301 height: 41 @@ -67,7 +67,6 @@ Item { visible: UiLogic.labelServerSettingsWaitInfoVisible } TextFieldType { -// x: 70 anchors.horizontalCenter: parent.horizontalCenter y: 80 width: 251 diff --git a/client/ui/qml/PageSetupWizard.qml b/client/ui/qml/Pages/PageSetupWizard.qml similarity index 98% rename from client/ui/qml/PageSetupWizard.qml rename to client/ui/qml/Pages/PageSetupWizard.qml index ea35a812..2000d191 100644 --- a/client/ui/qml/PageSetupWizard.qml +++ b/client/ui/qml/Pages/PageSetupWizard.qml @@ -2,11 +2,11 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 import PageEnum 1.0 import "./" +import "../Controls" +import "../Config" Item { id: root - width: GC.screenWidth - height: GC.screenHeight ImageButtonType { id: back_from_setup_wizard x: 10 diff --git a/client/ui/qml/PageSetupWizardHighLevel.qml b/client/ui/qml/Pages/PageSetupWizardHighLevel.qml similarity index 98% rename from client/ui/qml/PageSetupWizardHighLevel.qml rename to client/ui/qml/Pages/PageSetupWizardHighLevel.qml index 511918d5..df88e83b 100644 --- a/client/ui/qml/PageSetupWizardHighLevel.qml +++ b/client/ui/qml/Pages/PageSetupWizardHighLevel.qml @@ -2,11 +2,11 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 import PageEnum 1.0 import "./" +import "../Controls" +import "../Config" Item { id: root - width: GC.screenWidth - height: GC.screenHeight ImageButtonType { id: back_from_setup_wizard x: 10 diff --git a/client/ui/qml/PageSetupWizardLowLevel.qml b/client/ui/qml/Pages/PageSetupWizardLowLevel.qml similarity index 97% rename from client/ui/qml/PageSetupWizardLowLevel.qml rename to client/ui/qml/Pages/PageSetupWizardLowLevel.qml index cab5e518..84caaa86 100644 --- a/client/ui/qml/PageSetupWizardLowLevel.qml +++ b/client/ui/qml/Pages/PageSetupWizardLowLevel.qml @@ -1,11 +1,11 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 import "./" +import "../Controls" +import "../Config" Item { id: root - width: GC.screenWidth - height: GC.screenHeight ImageButtonType { id: back_from_setup_wizard x: 10 diff --git a/client/ui/qml/PageSetupWizardMediumLevel.qml b/client/ui/qml/Pages/PageSetupWizardMediumLevel.qml similarity index 97% rename from client/ui/qml/PageSetupWizardMediumLevel.qml rename to client/ui/qml/Pages/PageSetupWizardMediumLevel.qml index 263e40dc..eaf0d5ef 100644 --- a/client/ui/qml/PageSetupWizardMediumLevel.qml +++ b/client/ui/qml/Pages/PageSetupWizardMediumLevel.qml @@ -2,11 +2,11 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 import PageEnum 1.0 import "./" +import "../Controls" +import "../Config" Item { id: root - width: GC.screenWidth - height: GC.screenHeight ImageButtonType { id: back_from_setup_wizard x: 10 diff --git a/client/ui/qml/PageSetupWizardVPNMode.qml b/client/ui/qml/Pages/PageSetupWizardVPNMode.qml similarity index 97% rename from client/ui/qml/PageSetupWizardVPNMode.qml rename to client/ui/qml/Pages/PageSetupWizardVPNMode.qml index 0e37d802..c10f8b25 100644 --- a/client/ui/qml/PageSetupWizardVPNMode.qml +++ b/client/ui/qml/Pages/PageSetupWizardVPNMode.qml @@ -1,11 +1,11 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 import "./" +import "../Controls" +import "../Config" Item { id: root - width: GC.screenWidth - height: GC.screenHeight ImageButtonType { id: back_from_setup_wizard x: 10 diff --git a/client/ui/qml/PageShareConnection.qml b/client/ui/qml/Pages/PageShareConnection.qml similarity index 99% rename from client/ui/qml/PageShareConnection.qml rename to client/ui/qml/Pages/PageShareConnection.qml index a06c6da7..ddac49e3 100644 --- a/client/ui/qml/PageShareConnection.qml +++ b/client/ui/qml/Pages/PageShareConnection.qml @@ -1,11 +1,11 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 import "./" +import "../Controls" +import "../Config" Item { id: root - width: GC.screenWidth - height: GC.screenHeight ImageButtonType { id: back x: 10 diff --git a/client/ui/qml/PageSites.qml b/client/ui/qml/Pages/PageSites.qml similarity index 98% rename from client/ui/qml/PageSites.qml rename to client/ui/qml/Pages/PageSites.qml index 5f3c15f4..cafe4881 100644 --- a/client/ui/qml/PageSites.qml +++ b/client/ui/qml/Pages/PageSites.qml @@ -1,13 +1,13 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 -import "./" import Qt.labs.platform 1.0 import QtQuick.Dialogs 1.0 +import "./" +import "../Controls" +import "../Config" Item { id: root - width: GC.screenWidth - height: GC.screenHeight Text { font.family: "Lato" font.styleName: "normal" diff --git a/client/ui/qml/PageStart.qml b/client/ui/qml/Pages/PageStart.qml similarity index 99% rename from client/ui/qml/PageStart.qml rename to client/ui/qml/Pages/PageStart.qml index a598f582..363bfe74 100644 --- a/client/ui/qml/PageStart.qml +++ b/client/ui/qml/Pages/PageStart.qml @@ -1,12 +1,11 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 import "./" +import "../Controls" +import "../Config" Item { id: root - width: GC.screenWidth - height: GC.screenHeight - Image { anchors.horizontalCenter: root.horizontalCenter width: GC.trW(150) diff --git a/client/ui/qml/PageVPN.qml b/client/ui/qml/Pages/PageVPN.qml similarity index 82% rename from client/ui/qml/PageVPN.qml rename to client/ui/qml/Pages/PageVPN.qml index 49d55c2e..f11b4237 100644 --- a/client/ui/qml/PageVPN.qml +++ b/client/ui/qml/Pages/PageVPN.qml @@ -2,32 +2,33 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 import PageEnum 1.0 import "./" +import "../Controls" +import "../Config" Item { id: root - width: GC.screenWidth - height: GC.screenHeight + Image { - x: 20 - y: 424 - width: 325 - height: 1 - source: "qrc:/images/line.png" + anchors.horizontalCenter: parent.horizontalCenter + y: 0 + width: parent.width + +// width: 380 +// height: 325 + source: "qrc:/images/background_connected.png" } - Text { - x: 20 - y: 440 - width: 281 - height: 21 - font.family: "Lato" - font.styleName: "normal" - font.pixelSize: 15 - color: "#181922" - horizontalAlignment: Text.AlignLeft - verticalAlignment: Text.AlignVCenter - wrapMode: Text.Wrap - text: qsTr("How to use VPN") + + ImageButtonType { + x: parent.width - 40 + y: 10 + width: 31 + height: 31 + icon.source: "qrc:/images/settings_grey.png" + onClicked: { + UiLogic.goToPage(PageEnum.GeneralSettings) + } } + LabelType { id: error_text x: 0 @@ -40,7 +41,7 @@ Item { text: UiLogic.labelErrorText } Text { - x: 0 + anchors.horizontalCenter: parent.horizontalCenter y: 250 width: 380 height: 31 @@ -53,16 +54,10 @@ Item { wrapMode: Text.Wrap text: UiLogic.labelStateText } - Image { - x: 0 - y: 0 - width: 380 - height: 325 - source: "qrc:/images/background_connected.png" - } + BasicButtonType { id: button_connect - x: 150 + anchors.horizontalCenter: parent.horizontalCenter y: 200 width: 80 height: 40 @@ -82,76 +77,31 @@ Item { enabled: UiLogic.pushButtonConnectEnabled } - ImageButtonType { - x: 340 - y: 10 - width: 31 - height: 31 - icon.source: "qrc:/images/settings_grey.png" - onClicked: { - UiLogic.goToPage(PageEnum.GeneralSettings) - } - } - BasicButtonType { - id: button_add_site - x: 20 - y: 560 - width: 341 - height: 40 - text: qsTr("+ Add site") - enabled: UiLogic.pushButtonVpnAddSiteEnabled - background: Rectangle { - anchors.fill: parent - radius: 4 - color: { - if (!button_add_site.enabled) { - return "#484952" - } - if (button_add_site.containsMouse) { - return "#282932" - } - return "#181922" - } - } - - contentItem: Text { - anchors.fill: parent - font.family: "Lato" - font.styleName: "normal" - font.pixelSize: 16 - color: "#D4D4D4" - text: button_add_site.text - horizontalAlignment: Text.AlignHCenter - verticalAlignment: Text.AlignVCenter - } - antialiasing: true - onClicked: { - UiLogic.goToPage(PageEnum.Sites) - } - } Item { x: 0 - y: 360 - width: 380 + anchors.bottom: line.top + anchors.bottomMargin: 10 + width: parent.width height: 51 Image { - x: 311 + anchors.horizontalCenter: upload_label.horizontalCenter y: 10 width: 15 height: 15 source: "qrc:/images/upload.png" } Image { - x: 53 + anchors.horizontalCenter: download_label.horizontalCenter y: 10 width: 15 height: 15 source: "qrc:/images/download.png" } Text { + id: download_label x: 0 y: 20 - width: 127 + width: 130 height: 30 font.family: "Lato" font.styleName: "normal" @@ -163,9 +113,10 @@ Item { text: UiLogic.labelSpeedReceivedText } Text { - x: 260 + id: upload_label + x: parent.width - width y: 20 - width: 118 + width: 130 height: 30 font.family: "Lato" font.styleName: "normal" @@ -177,9 +128,38 @@ Item { text: UiLogic.labelSpeedSentText } } - Item { + + Rectangle { + id: line x: 20 - y: 470 + width: parent.width - 40 + height: 1 + anchors.bottom: conn_type_label.top + anchors.bottomMargin: 10 + color: "#DDDDDD" + } + + Text { + id: conn_type_label + x: 20 + anchors.bottom: conn_type_group.top + anchors.bottomMargin: 10 + width: 281 + height: 21 + font.family: "Lato" + font.styleName: "normal" + font.pixelSize: 15 + color: "#181922" + horizontalAlignment: Text.AlignLeft + verticalAlignment: Text.AlignVCenter + wrapMode: Text.Wrap + text: qsTr("How to use VPN") + } + + Item { + id: conn_type_group + x: 20 + anchors.bottom: button_add_site.top width: 351 height: 91 enabled: UiLogic.widgetVpnModeEnabled @@ -221,4 +201,43 @@ Item { } } } + + BasicButtonType { + id: button_add_site + anchors.horizontalCenter: parent.horizontalCenter + y: parent.height - 60 + //anchors.bottom: parent.bottom + width: parent.width - 40 + height: 40 + text: qsTr("+ Add site") + enabled: UiLogic.pushButtonVpnAddSiteEnabled + background: Rectangle { + anchors.fill: parent + radius: 4 + color: { + if (!button_add_site.enabled) { + return "#484952" + } + if (button_add_site.containsMouse) { + return "#282932" + } + return "#181922" + } + } + + contentItem: Text { + anchors.fill: parent + font.family: "Lato" + font.styleName: "normal" + font.pixelSize: 16 + color: "#D4D4D4" + text: button_add_site.text + horizontalAlignment: Text.AlignHCenter + verticalAlignment: Text.AlignVCenter + } + antialiasing: true + onClicked: { + UiLogic.goToPage(PageEnum.Sites) + } + } } diff --git a/client/ui/qml/RadioButtonType.qml b/client/ui/qml/RadioButtonType.qml deleted file mode 100644 index 03a82000..00000000 --- a/client/ui/qml/RadioButtonType.qml +++ /dev/null @@ -1,15 +0,0 @@ -import QtQuick 2.12 -import QtQuick.Controls 2.12 - -RadioButton { - id: root - contentItem: Text { - text: root.text - font.family: "Lato" - font.styleName: "normal" - font.pixelSize: 16 - color: "#181922" - verticalAlignment: Text.AlignVCenter - leftPadding: root.indicator.width + root.spacing - } -} diff --git a/client/ui/qml/TitleBar.qml b/client/ui/qml/TitleBar.qml index 46e2737f..deb9e1a0 100644 --- a/client/ui/qml/TitleBar.qml +++ b/client/ui/qml/TitleBar.qml @@ -1,6 +1,7 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 import "./" +import "Config" Rectangle { id: root diff --git a/client/ui/qml/main.qml b/client/ui/qml/main.qml index 0b39b621..590696f7 100644 --- a/client/ui/qml/main.qml +++ b/client/ui/qml/main.qml @@ -1,12 +1,18 @@ import QtQuick 2.14 import QtQuick.Window 2.14 import QtQuick.Controls 2.12 +import QtQuick.Controls.Material 2.12 import PageEnum 1.0 import Qt.labs.platform 1.1 import QtQuick.Dialogs 1.1 import "./" +import "Pages" +import "Config" Window { + Material.theme: Material.Dark + Material.accent: Material.Purple + id: root visible: true width: GC.screenWidth @@ -15,7 +21,7 @@ Window { UiLogic.onCloseWindow() } - flags: Qt.FramelessWindowHint + //flags: Qt.FramelessWindowHint title: "AmneziaVPN" function getPageComponent(page) { switch (page) { @@ -232,16 +238,19 @@ Window { Rectangle { y: GC.isDesktop() ? titleBar.height : 0 - width: GC.screenWidth - height: GC.screenHeight +// width: GC.screenWidth +// height: GC.screenHeight + anchors.fill: parent color: "white" } StackView { id: pageLoader y: GC.isDesktop() ? titleBar.height : 0 - width: GC.screenWidth - height: GC.screenHeight +// width: GC.screenWidth +// height: GC.screenHeight + anchors.fill: parent + // initialItem: page_servers onCurrentItemChanged: { let pageEnum = root.getPageEnum(currentItem)