mirror of
https://github.com/amnezia-vpn/amnezia-client.git
synced 2026-06-23 02:00:20 +07:00
Merge pull request #328 from amnezia-vpn/bugfix/add_top_close_button
added close button when drawer shown in the topright corner
This commit is contained in:
@@ -27,6 +27,8 @@ PageType {
|
||||
target: ExportController
|
||||
|
||||
function onGenerateConfig(type) {
|
||||
shareConnectionDrawer.needCloseButton = false
|
||||
|
||||
shareConnectionDrawer.open()
|
||||
shareConnectionDrawer.contentVisible = false
|
||||
PageController.showBusyIndicator(true)
|
||||
@@ -58,6 +60,10 @@ PageType {
|
||||
}
|
||||
|
||||
PageController.showBusyIndicator(false)
|
||||
|
||||
shareConnectionDrawer.needCloseButton = true
|
||||
PageController.showTopCloseButton(true)
|
||||
|
||||
shareConnectionDrawer.contentVisible = true
|
||||
}
|
||||
|
||||
|
||||
@@ -19,16 +19,22 @@ PageType {
|
||||
function onGoToPageHome() {
|
||||
tabBar.currentIndex = 0
|
||||
tabBarStackView.goToTabBarPage(PageEnum.PageHome)
|
||||
|
||||
PageController.updateDrawerRootPage(PageEnum.PageHome)
|
||||
}
|
||||
|
||||
function onGoToPageSettings() {
|
||||
tabBar.currentIndex = 2
|
||||
tabBarStackView.goToTabBarPage(PageEnum.PageSettings)
|
||||
|
||||
PageController.updateDrawerRootPage(PageEnum.PageSettings)
|
||||
}
|
||||
|
||||
function onGoToPageViewConfig() {
|
||||
var pagePath = PageController.getPagePath(PageEnum.PageSetupWizardViewConfig)
|
||||
tabBarStackView.push(pagePath, { "objectName" : pagePath }, StackView.PushTransition)
|
||||
|
||||
PageController.updateDrawerRootPage(PageEnum.PageSetupWizardViewConfig)
|
||||
}
|
||||
|
||||
function onShowBusyIndicator(visible) {
|
||||
@@ -37,6 +43,10 @@ PageType {
|
||||
tabBar.enabled = !visible
|
||||
}
|
||||
|
||||
function onShowTopCloseButton(visible) {
|
||||
topCloseButton.visible = visible
|
||||
}
|
||||
|
||||
function onEnableTabBar(enabled) {
|
||||
tabBar.enabled = enabled
|
||||
}
|
||||
@@ -55,6 +65,8 @@ PageType {
|
||||
} else {
|
||||
tabBarStackView.push(pagePath, { "objectName" : pagePath }, StackView.Immediate)
|
||||
}
|
||||
|
||||
PageController.updateDrawerRootPage(page)
|
||||
}
|
||||
|
||||
function onGoToStartPage() {
|
||||
@@ -111,6 +123,8 @@ PageType {
|
||||
var pagePath = PageController.getPagePath(page)
|
||||
tabBarStackView.clear(StackView.Immediate)
|
||||
tabBarStackView.replace(pagePath, { "objectName" : pagePath }, StackView.Immediate)
|
||||
|
||||
PageController.updateDrawerRootPage(page)
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
@@ -195,4 +209,10 @@ PageType {
|
||||
anchors.centerIn: parent
|
||||
z: 1
|
||||
}
|
||||
|
||||
TopCloseButtonType {
|
||||
id: topCloseButton
|
||||
x: tabBarStackView.width - topCloseButton.width
|
||||
z: 1
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user