Merge pull request #666 from amnezia-vpn/bugfix/Revert_PR_596

ISSUE: In start page, icon is highlighted not correctly when press ESC key
This commit is contained in:
pokamest 2024-03-05 05:07:05 -08:00 committed by GitHub
commit 79ff1b81e0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -43,9 +43,6 @@ PageType {
} }
function onClosePage() { function onClosePage() {
tabBar.isServerInfoShow = tabBarStackView.currentItem.objectName !== PageController.getPagePath(PageEnum.PageSettingsServerInfo)
&& tabBarStackView.currentItem.objectName !== PageController.getPagePath(PageEnum.PageSettingsSplitTunneling)
if (tabBarStackView.depth <= 1) { if (tabBarStackView.depth <= 1) {
return return
} }
@ -60,8 +57,6 @@ PageType {
} else { } else {
tabBarStackView.push(pagePath, { "objectName" : pagePath }, StackView.Immediate) tabBarStackView.push(pagePath, { "objectName" : pagePath }, StackView.Immediate)
} }
tabBar.isServerInfoShow = (page === PageEnum.PageSettingsServerInfo) || (page === PageEnum.PageSettingsSplitTunneling) || tabBar.isServerInfoShow
} }
function onGoToStartPage() { function onGoToStartPage() {
@ -147,7 +142,6 @@ PageType {
var pagePath = PageController.getPagePath(page) var pagePath = PageController.getPagePath(page)
tabBarStackView.clear(StackView.Immediate) tabBarStackView.clear(StackView.Immediate)
tabBarStackView.replace(pagePath, { "objectName" : pagePath }, StackView.Immediate) tabBarStackView.replace(pagePath, { "objectName" : pagePath }, StackView.Immediate)
tabBar.isServerInfoShow = false
} }
Component.onCompleted: { Component.onCompleted: {
@ -161,7 +155,6 @@ PageType {
id: tabBar id: tabBar
property int previousIndex: 0 property int previousIndex: 0
property bool isServerInfoShow: false
anchors.right: parent.right anchors.right: parent.right
anchors.left: parent.left anchors.left: parent.left
@ -192,7 +185,7 @@ PageType {
} }
TabImageButtonType { TabImageButtonType {
isSelected: tabBar.isServerInfoShow ? false : tabBar.currentIndex === 0 isSelected: tabBar.currentIndex === 0
image: "qrc:/images/controls/home.svg" image: "qrc:/images/controls/home.svg"
onClicked: { onClicked: {
tabBarStackView.goToTabBarPage(PageEnum.PageHome) tabBarStackView.goToTabBarPage(PageEnum.PageHome)
@ -226,7 +219,7 @@ PageType {
} }
TabImageButtonType { TabImageButtonType {
isSelected: tabBar.isServerInfoShow ? true : tabBar.currentIndex === 2 isSelected: tabBar.currentIndex === 2
image: "qrc:/images/controls/settings-2.svg" image: "qrc:/images/controls/settings-2.svg"
onClicked: { onClicked: {
tabBarStackView.goToTabBarPage(PageEnum.PageSettings) tabBarStackView.goToTabBarPage(PageEnum.PageSettings)