Added tab navigation functional. (#721)

- Added tab navigation functional.
- In basic types added parentFlickable property, which will help to ensure, that the item is visible within flickable parent during tab navigation.
- Added focus state for some basic types.
- In PageType qml file added lastItemTabClicked function, which will help to focus tab bar buttons when the last tab on the current page clicked.
- Added Focus for back button for all pages and drawers.
- Added scroll on tab for Servers ListView on PageHome.
This commit is contained in:
Garegin Harutyunyan 2024-04-18 17:54:55 +04:00 committed by GitHub
parent d50e7dd3f4
commit 0e4ae26bae
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
66 changed files with 2269 additions and 143 deletions

View file

@ -22,6 +22,8 @@ PageType {
}
}
defaultActiveFocusItem: focusItem
FlickableType {
id: fl
anchors.top: parent.top
@ -37,8 +39,15 @@ PageType {
spacing: 0
Item {
id: focusItem
KeyNavigation.tab: backButton
}
BackButtonType {
id: backButton
Layout.topMargin: 20
KeyNavigation.tab: fileButton.rightButton
}
HeaderType {
@ -61,6 +70,7 @@ PageType {
}
LabelWithButtonType {
id: fileButton
Layout.fillWidth: true
Layout.topMargin: 16
@ -68,6 +78,8 @@ PageType {
rightImageSource: "qrc:/images/controls/chevron-right.svg"
leftImageSource: "qrc:/images/controls/folder-open.svg"
KeyNavigation.tab: qrButton.visible ? qrButton.rightButton : textButton.rightButton
clickedFunction: function() {
var nameFilter = !ServersModel.getServersCount() ? "Config or backup files (*.vpn *.ovpn *.conf *.json *.backup)" :
"Config files (*.vpn *.ovpn *.conf *.json)"
@ -83,6 +95,7 @@ PageType {
DividerType {}
LabelWithButtonType {
id: qrButton
Layout.fillWidth: true
visible: SettingsController.isCameraPresent()
@ -90,6 +103,8 @@ PageType {
rightImageSource: "qrc:/images/controls/chevron-right.svg"
leftImageSource: "qrc:/images/controls/qr-code.svg"
KeyNavigation.tab: textButton.rightButton
clickedFunction: function() {
ImportController.startDecodingQr()
if (Qt.platform.os === "ios") {
@ -103,12 +118,15 @@ PageType {
}
LabelWithButtonType {
id: textButton
Layout.fillWidth: true
text: qsTr("Key as text")
rightImageSource: "qrc:/images/controls/chevron-right.svg"
leftImageSource: "qrc:/images/controls/text-cursor.svg"
Keys.onTabPressed: lastItemTabClicked(focusItem)
clickedFunction: function() {
PageController.goToPage(PageEnum.PageSetupWizardTextKey)
}