Skip to content

Commit

Permalink
Merge pull request #370 from amnezia-vpn/feature/custom_drawer_component
Browse files Browse the repository at this point in the history
added new drawer2type for replacing drawertype
  • Loading branch information
ronoaer committed Oct 21, 2023
2 parents 2a4cefb + 023c347 commit 4551cf0
Show file tree
Hide file tree
Showing 28 changed files with 620 additions and 257 deletions.
1 change: 1 addition & 0 deletions client/resources.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@
<file>ui/qml/Pages2/PageServiceDnsSettings.qml</file>
<file>ui/qml/Controls2/TopCloseButtonType.qml</file>
<file>images/controls/x-circle.svg</file>
<file>ui/qml/Controls2/Drawer2Type.qml</file>
<file>ui/qml/Pages2/PageProtocolAwgSettings.qml</file>
<file>server_scripts/awg/template.conf</file>
<file>server_scripts/awg/start.sh</file>
Expand Down
7 changes: 5 additions & 2 deletions client/ui/qml/Components/ConnectionTypeSelectionDrawer.qml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,16 @@ import "../Controls2"
import "../Controls2/TextTypes"
import "../Config"

DrawerType {
Drawer2Type {
id: root

width: parent.width
height: parent.height * 0.4375
height: parent.height
contentHeight: parent.height * 0.4375

ColumnLayout {
parent: root.contentParent

anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
Expand Down
2 changes: 1 addition & 1 deletion client/ui/qml/Components/HomeContainersListView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ ListView {
isDefault = true

menuContent.currentIndex = index
containersDropDown.menuVisible = false
containersDropDown.menu.close()
} else {
if (!isSupported && isInstalled) {
PageController.showErrorMessage(qsTr("The selected protocol is not supported on the current platform"))
Expand Down
10 changes: 7 additions & 3 deletions client/ui/qml/Components/QuestionDrawer.qml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import QtQuick.Layouts
import "../Controls2"
import "../Controls2/TextTypes"

DrawerType {
Drawer2Type {
id: root

property string headerText
Expand All @@ -15,12 +15,14 @@ DrawerType {

property var yesButtonFunction
property var noButtonFunction
property real drawerHeight: 0.5

width: parent.width
height: content.implicitHeight + 32
height: parent.height
contentHeight: parent.height * drawerHeight

ColumnLayout {
id: content
parent: root.contentParent

anchors.top: parent.top
anchors.left: parent.left
Expand All @@ -29,6 +31,8 @@ DrawerType {
anchors.rightMargin: 16
anchors.leftMargin: 16

// visible: false

spacing: 8

Header2TextType {
Expand Down
8 changes: 6 additions & 2 deletions client/ui/qml/Components/SelectLanguageDrawer.qml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,18 @@ import QtQuick.Layouts
import "../Controls2"
import "../Controls2/TextTypes"

DrawerType {
Drawer2Type {
id: root

width: parent.width
height: parent.height * 0.9
height: parent.height
contentHeight: parent.height * 0.9

ColumnLayout {
id: backButton

parent: root.contentParent

anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
Expand All @@ -28,6 +31,7 @@ DrawerType {
}

FlickableType {
parent: root.contentParent
anchors.top: backButton.bottom
anchors.left: parent.left
anchors.right: parent.right
Expand Down
27 changes: 20 additions & 7 deletions client/ui/qml/Components/ShareConnectionDrawer.qml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import "../Controls2/TextTypes"
import "../Config"
import "../Components"

DrawerType {
Drawer2Type {
id: root

property alias headerText: header.headerText
Expand All @@ -28,9 +28,10 @@ DrawerType {
property string configFileName: "amnezia_config.vpn"

width: parent.width
height: parent.height * 0.9
height: parent.height
contentHeight: parent.height * 0.9

onClosed: {
onDrawerClosed: {
configExtension = ".vpn"
configCaption = qsTr("Save AmneziaVPN config")
configFileName = "amnezia_config"
Expand All @@ -41,6 +42,9 @@ DrawerType {

Header2Type {
id: header

parent: root.contentParent

anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
Expand All @@ -50,6 +54,8 @@ DrawerType {
}

FlickableType {
parent: root.contentParent

anchors.top: header.bottom
anchors.bottom: parent.bottom
contentHeight: content.height + 32
Expand Down Expand Up @@ -126,30 +132,37 @@ DrawerType {
text: qsTr("Show connection settings")

onClicked: {
configContentDrawer.visible = true
configContentDrawer.open()
}
}

DrawerType {
Drawer2Type {
id: configContentDrawer

parent: root
width: parent.width
height: parent.height * 0.9
height: parent.height

contentHeight: parent.height * 0.9

BackButtonType {
id: backButton

parent: configContentDrawer.contentParent

anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
anchors.topMargin: 16

backButtonFunction: function() {
configContentDrawer.visible = false
configContentDrawer.close()
}
}

FlickableType {
parent: configContentDrawer.contentParent

anchors.top: backButton.bottom
anchors.left: parent.left
anchors.right: parent.right
Expand Down
Loading

0 comments on commit 4551cf0

Please sign in to comment.