added close button when drawer shown in the topright corner

This commit is contained in:
ronoaer 2023-09-16 08:05:43 +08:00
parent c0aca97083
commit 8a3bdf136b
7 changed files with 124 additions and 0 deletions

View file

@ -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
}

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() {
@ -99,6 +111,8 @@ PageType {
var pagePath = PageController.getPagePath(page)
tabBarStackView.clear(StackView.Immediate)
tabBarStackView.replace(pagePath, { "objectName" : pagePath }, StackView.Immediate)
PageController.updateDrawerRootPage(page)
}
Component.onCompleted: {
@ -183,4 +197,10 @@ PageType {
anchors.centerIn: parent
z: 1
}
TopCloseButtonType {
id: topCloseButton
x: tabBarStackView.width - topCloseButton.width
z: 1
}
}