feature/custom-drawer (#563)

Replaced all the DrawerType with DrawerType2
This commit is contained in:
Nethius 2024-02-16 15:24:06 +05:00 committed by GitHub
parent fd030a5fd4
commit 074562b141
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
35 changed files with 1331 additions and 1319 deletions

View file

@ -41,8 +41,6 @@ PageType {
shareConnectionDrawer.headerText = qsTr("Connection to ") + serverSelector.text
shareConnectionDrawer.configContentHeaderText = qsTr("File with connection settings to ") + serverSelector.text
shareConnectionDrawer.needCloseButton = false
shareConnectionDrawer.open()
shareConnectionDrawer.contentVisible = false
PageController.showBusyIndicator(true)
@ -80,11 +78,6 @@ PageType {
}
PageController.showBusyIndicator(false)
shareConnectionDrawer.needCloseButton = true
PageController.showTopCloseButton(true)
shareConnectionDrawer.contentVisible = true
}
function onExportErrorOccurred(errorMessage) {
@ -154,14 +147,15 @@ PageType {
shareFullAccessDrawer.open()
}
DrawerType {
DrawerType2 {
id: shareFullAccessDrawer
width: root.width
height: root.height * 0.45
parent: root
anchors.fill: parent
expandedHeight: root.height * 0.45
ColumnLayout {
expandedContent: ColumnLayout {
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
@ -276,6 +270,7 @@ PageType {
Layout.topMargin: 16
drawerHeight: 0.4375
drawerParent: root
descriptionText: qsTr("Server")
headerText: qsTr("Server")
@ -305,7 +300,7 @@ PageType {
serverSelector.severSelectorIndexChanged()
}
serverSelector.menuVisible = false
serverSelector.close()
}
Component.onCompleted: {
@ -328,6 +323,7 @@ PageType {
Layout.topMargin: 16
drawerHeight: 0.5
drawerParent: root
descriptionText: qsTr("Protocol")
headerText: qsTr("Protocol")
@ -358,7 +354,7 @@ PageType {
clickedFunction: function() {
handler()
protocolSelector.menuVisible = false
protocolSelector.close()
}
Connections {
@ -423,6 +419,7 @@ PageType {
Layout.topMargin: 16
drawerHeight: 0.4375
drawerParent: root
visible: accessTypeSelector.currentIndex === 0
enabled: root.connectionTypesModel.length > 1
@ -446,7 +443,7 @@ PageType {
clickedFunction: function() {
exportTypeSelector.text = selectedText
exportTypeSelector.currentIndex = currentIndex
exportTypeSelector.menuVisible = false
exportTypeSelector.close()
}
Component.onCompleted: {
@ -456,10 +453,6 @@ PageType {
}
}
ShareConnectionDrawer {
id: shareConnectionDrawer
}
BasicButtonType {
Layout.fillWidth: true
Layout.topMargin: 40
@ -561,13 +554,15 @@ PageType {
DividerType {}
DrawerType {
DrawerType2 {
id: clientInfoDrawer
width: root.width
height: root.height * 0.5
parent: root
ColumnLayout {
anchors.fill: parent
expandedHeight: root.height * 0.5
expandedContent: ColumnLayout {
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
@ -602,26 +597,29 @@ PageType {
clientNameEditDrawer.open()
}
DrawerType {
DrawerType2 {
id: clientNameEditDrawer
width: root.width
height: root.height * 0.35
parent: root
onVisibleChanged: {
if (clientNameEditDrawer.visible) {
clientNameEditor.textField.forceActiveFocus()
}
}
anchors.fill: parent
expandedHeight: root.height * 0.35
ColumnLayout {
expandedContent: ColumnLayout {
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
anchors.topMargin: 16
anchors.topMargin: 32
anchors.leftMargin: 16
anchors.rightMargin: 16
Connections {
target: clientNameEditDrawer
function onOpened() {
clientNameEditor.textField.forceActiveFocus()
}
}
TextFieldWithHeaderType {
id: clientNameEditor
Layout.fillWidth: true
@ -669,20 +667,19 @@ PageType {
text: qsTr("Revoke")
onClicked: function() {
questionDrawer.headerText = qsTr("Revoke the config for a user - %1?").arg(clientName)
questionDrawer.descriptionText = qsTr("The user will no longer be able to connect to your server.")
questionDrawer.yesButtonText = qsTr("Continue")
questionDrawer.noButtonText = qsTr("Cancel")
var headerText = qsTr("Revoke the config for a user - %1?").arg(clientName)
var descriptionText = qsTr("The user will no longer be able to connect to your server.")
var yesButtonText = qsTr("Continue")
var noButtonText = qsTr("Cancel")
questionDrawer.yesButtonFunction = function() {
questionDrawer.close()
var yesButtonFunction = function() {
clientInfoDrawer.close()
root.revokeConfig(index)
}
questionDrawer.noButtonFunction = function() {
questionDrawer.close()
var noButtonFunction = function() {
}
questionDrawer.open()
showQuestionDrawer(headerText, descriptionText, yesButtonText, noButtonText, yesButtonFunction, noButtonFunction)
}
}
}
@ -690,12 +687,15 @@ PageType {
}
}
}
QuestionDrawer {
id: questionDrawer
}
}
}
ShareConnectionDrawer {
id: shareConnectionDrawer
anchors.fill: parent
}
MouseArea {
anchors.fill: parent
onPressed: function(mouse) {