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:
Nethius
2023-09-18 10:48:13 +05:00
committed by GitHub
7 changed files with 118 additions and 0 deletions
+20
View File
@@ -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
}
}