- Remove additional focus frames for buttons inside text fields.

- For mobile platforms, disabled auto-focus on the first element when navigating on the page.
- Added auto-focus for the rest of the Drawer components
This commit is contained in:
Garegin866
2024-03-10 00:20:32 +04:00
parent 080e1d98c6
commit 8d07a910bc
26 changed files with 240 additions and 14 deletions
@@ -26,6 +26,14 @@ DrawerType2 {
root.expandedHeight = content.implicitHeight + 32 root.expandedHeight = content.implicitHeight + 32
} }
Connections {
target: root
enabled: !GC.isMobile()
function onOpened() {
config.rightButton.forceActiveFocus()
}
}
Header2Type { Header2Type {
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: 24 Layout.topMargin: 24
@@ -37,7 +45,7 @@ DrawerType2 {
} }
LabelWithButtonType { LabelWithButtonType {
id: ip id: config
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: 16 Layout.topMargin: 16
@@ -48,11 +56,14 @@ DrawerType2 {
PageController.goToPage(PageEnum.PageSetupWizardCredentials) PageController.goToPage(PageEnum.PageSetupWizardCredentials)
root.close() root.close()
} }
KeyNavigation.tab: configFromFile.rightButton
} }
DividerType {} DividerType {}
LabelWithButtonType { LabelWithButtonType {
id: configFromFile
Layout.fillWidth: true Layout.fillWidth: true
text: qsTr("Open config file, key or QR code") text: qsTr("Open config file, key or QR code")
@@ -62,6 +73,8 @@ DrawerType2 {
PageController.goToPage(PageEnum.PageSetupWizardConfigSource) PageController.goToPage(PageEnum.PageSetupWizardConfigSource)
root.close() root.close()
} }
KeyNavigation.tab: config.rightButton
} }
DividerType {} DividerType {}
@@ -22,6 +22,18 @@ DrawerType2 {
anchors.right: parent.right anchors.right: parent.right
spacing: 0 spacing: 0
Connections {
target: root
enabled: !GC.isMobile()
function onOpened() {
if (splitTunneling.visible) {
splitTunneling.rightButton.forceActiveFocus()
} else {
splitTunnelingSiteBased.rightButton.forceActiveFocus()
}
}
}
Header2Type { Header2Type {
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: 24 Layout.topMargin: 24
@@ -34,6 +46,7 @@ DrawerType2 {
} }
LabelWithButtonType { LabelWithButtonType {
id: splitTunneling
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: 16 Layout.topMargin: 16
@@ -47,6 +60,8 @@ DrawerType2 {
// PageController.goToPage(PageEnum.PageSettingsSplitTunneling) // PageController.goToPage(PageEnum.PageSettingsSplitTunneling)
// root.close() // root.close()
} }
KeyNavigation.tab: splitTunnelingSiteBased.rightButton
} }
DividerType { DividerType {
@@ -54,6 +69,7 @@ DrawerType2 {
} }
LabelWithButtonType { LabelWithButtonType {
id: splitTunnelingSiteBased
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: 16 Layout.topMargin: 16
@@ -67,12 +83,14 @@ DrawerType2 {
PageController.goToPage(PageEnum.PageSettingsSplitTunneling) PageController.goToPage(PageEnum.PageSettingsSplitTunneling)
root.close() root.close()
} }
KeyNavigation.tab: appBasedSplitTunneling.visible ? appBasedSplitTunneling.rightButton : null
} }
DividerType { DividerType {
} }
LabelWithButtonType { LabelWithButtonType {
id: appBasedSplitTunneling
Layout.fillWidth: true Layout.fillWidth: true
visible: false visible: false
@@ -83,6 +101,8 @@ DrawerType2 {
// PageController.goToPage(PageEnum.PageSetupWizardConfigSource) // PageController.goToPage(PageEnum.PageSetupWizardConfigSource)
root.close() root.close()
} }
KeyNavigation.tab: splitTunneling.rightButton
} }
DividerType { DividerType {
@@ -4,6 +4,7 @@ import QtQuick.Layouts
import "../Controls2" import "../Controls2"
import "../Controls2/TextTypes" import "../Controls2/TextTypes"
import "../Config"
DrawerType2 { DrawerType2 {
id: root id: root
@@ -29,6 +30,14 @@ DrawerType2 {
root.expandedHeight = content.implicitHeight + 32 root.expandedHeight = content.implicitHeight + 32
} }
Connections {
target: root
enabled: !GC.isMobile()
function onOpened() {
yesButton.forceActiveFocus()
}
}
Header2TextType { Header2TextType {
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: 16 Layout.topMargin: 16
@@ -48,6 +57,7 @@ DrawerType2 {
} }
BasicButtonType { BasicButtonType {
id: yesButton
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: 16 Layout.topMargin: 16
Layout.rightMargin: 16 Layout.rightMargin: 16
@@ -60,9 +70,11 @@ DrawerType2 {
yesButtonFunction() yesButtonFunction()
} }
} }
KeyNavigation.tab: noButton
} }
BasicButtonType { BasicButtonType {
id: noButton
Layout.fillWidth: true Layout.fillWidth: true
Layout.rightMargin: 16 Layout.rightMargin: 16
Layout.leftMargin: 16 Layout.leftMargin: 16
@@ -81,6 +93,7 @@ DrawerType2 {
noButtonFunction() noButtonFunction()
} }
} }
KeyNavigation.tab: yesButton
} }
} }
} }
@@ -40,9 +40,9 @@ DrawerType2 {
Connections { Connections {
target: root target: root
enabled: !GC.isMobile()
function onOpened() { function onOpened() {
header.forceActiveFocus() shareButton.forceActiveFocus()
} }
} }
@@ -56,8 +56,6 @@ DrawerType2 {
anchors.rightMargin: 16 anchors.rightMargin: 16
headerText: root.headerText headerText: root.headerText
KeyNavigation.tab: shareButton
} }
FlickableType { FlickableType {
@@ -85,8 +83,6 @@ DrawerType2 {
text: qsTr("Share") text: qsTr("Share")
imageSource: "qrc:/images/controls/share-2.svg" imageSource: "qrc:/images/controls/share-2.svg"
KeyNavigation.tab: copyConfigTextButton
clickedFunc: function() { clickedFunc: function() {
var fileName = "" var fileName = ""
if (GC.isMobile()) { if (GC.isMobile()) {
@@ -104,6 +100,8 @@ DrawerType2 {
PageController.showBusyIndicator(false) PageController.showBusyIndicator(false)
} }
} }
KeyNavigation.tab: copyConfigTextButton
} }
BasicButtonType { BasicButtonType {
@@ -163,7 +161,7 @@ DrawerType2 {
configContentDrawer.open() configContentDrawer.open()
} }
KeyNavigation.tab: header KeyNavigation.tab: shareButton
} }
DrawerType2 { DrawerType2 {
@@ -12,6 +12,9 @@ Button {
property string pressedColor: Qt.rgba(1, 1, 1, 0.12) property string pressedColor: Qt.rgba(1, 1, 1, 0.12)
property string disableColor: "#2C2D30" property string disableColor: "#2C2D30"
property string borderFocusedColor: "#D7D8DB"
property int borderFocusedWidth: 1
property string imageColor: "#878B91" property string imageColor: "#878B91"
property string disableImageColor: "#2C2D30" property string disableImageColor: "#2C2D30"
@@ -31,6 +34,9 @@ Button {
id: background id: background
anchors.fill: parent anchors.fill: parent
border.color: root.activeFocus ? root.borderFocusedColor : "transparent"
border.width: root.activeFocus ? root.borderFocusedWidth : "transparent"
color: { color: {
if (root.enabled) { if (root.enabled) {
if (root.pressed) { if (root.pressed) {
@@ -27,6 +27,8 @@ Item {
property string rightImageColor: "#d7d8db" property string rightImageColor: "#d7d8db"
property alias rightButton: rightImage
property bool descriptionOnTop: false property bool descriptionOnTop: false
implicitWidth: content.implicitWidth + content.anchors.topMargin + content.anchors.bottomMargin implicitWidth: content.implicitWidth + content.anchors.topMargin + content.anchors.bottomMargin
@@ -207,4 +209,16 @@ Item {
} }
} }
} }
Keys.onEnterPressed: {
if (clickedFunction && typeof clickedFunction === "function") {
clickedFunction()
}
}
Keys.onReturnPressed: {
if (clickedFunction && typeof clickedFunction === "function") {
clickedFunction()
}
}
} }
+9 -1
View File
@@ -2,6 +2,8 @@ import QtQuick
import QtQuick.Controls import QtQuick.Controls
import QtQuick.Layouts import QtQuick.Layouts
import "../Config"
Item { Item {
id: root id: root
@@ -9,6 +11,12 @@ Item {
property var defaultActiveFocusItem: null property var defaultActiveFocusItem: null
onVisibleChanged: {
if (visible && !GC.isMobile()) {
timer.start()
}
}
// MouseArea { // MouseArea {
// id: globalMouseArea // id: globalMouseArea
// z: 99 // z: 99
@@ -32,6 +40,6 @@ Item {
} }
} }
repeat: false // Stop the timer after one trigger repeat: false // Stop the timer after one trigger
running: true // Start the timer running: !GC.isMobile() // Start the timer
} }
} }
@@ -137,6 +137,7 @@ Item {
// textColor: "#D7D8DB" // textColor: "#D7D8DB"
// borderWidth: 0 // borderWidth: 0
focusPolicy: Qt.NoFocus
text: root.buttonText text: root.buttonText
imageSource: root.buttonImageSource imageSource: root.buttonImageSource
@@ -191,10 +192,12 @@ Item {
} }
Keys.onEnterPressed: { Keys.onEnterPressed: {
KeyNavigation.tab.forceActiveFocus(); if (KeyNavigation.tab)
KeyNavigation.tab.forceActiveFocus();
} }
Keys.onReturnPressed: { Keys.onReturnPressed: {
KeyNavigation.tab.forceActiveFocus(); if (KeyNavigation.tab)
KeyNavigation.tab.forceActiveFocus();
} }
} }
@@ -28,6 +28,8 @@ PageType {
} }
} }
defaultActiveFocusItem: removeButton.rightButton
FlickableType { FlickableType {
id: fl id: fl
anchors.top: backButton.bottom anchors.top: backButton.bottom
+12
View File
@@ -13,6 +13,8 @@ import "../Config"
PageType { PageType {
id: root id: root
defaultActiveFocusItem: servers.rightButton
FlickableType { FlickableType {
id: fl id: fl
anchors.top: parent.top anchors.top: parent.top
@@ -38,6 +40,7 @@ PageType {
} }
LabelWithButtonType { LabelWithButtonType {
id: servers
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: 16 Layout.topMargin: 16
@@ -48,11 +51,14 @@ PageType {
clickedFunction: function() { clickedFunction: function() {
PageController.goToPage(PageEnum.PageSettingsServersList) PageController.goToPage(PageEnum.PageSettingsServersList)
} }
KeyNavigation.tab: connection.rightButton
} }
DividerType {} DividerType {}
LabelWithButtonType { LabelWithButtonType {
id: connection
Layout.fillWidth: true Layout.fillWidth: true
text: qsTr("Connection") text: qsTr("Connection")
@@ -62,11 +68,13 @@ PageType {
clickedFunction: function() { clickedFunction: function() {
PageController.goToPage(PageEnum.PageSettingsConnection) PageController.goToPage(PageEnum.PageSettingsConnection)
} }
KeyNavigation.tab: application.rightButton
} }
DividerType {} DividerType {}
LabelWithButtonType { LabelWithButtonType {
id: application
Layout.fillWidth: true Layout.fillWidth: true
text: qsTr("Application") text: qsTr("Application")
@@ -76,11 +84,13 @@ PageType {
clickedFunction: function() { clickedFunction: function() {
PageController.goToPage(PageEnum.PageSettingsApplication) PageController.goToPage(PageEnum.PageSettingsApplication)
} }
KeyNavigation.tab: backup.rightButton
} }
DividerType {} DividerType {}
LabelWithButtonType { LabelWithButtonType {
id: backup
Layout.fillWidth: true Layout.fillWidth: true
text: qsTr("Backup") text: qsTr("Backup")
@@ -90,6 +100,7 @@ PageType {
clickedFunction: function() { clickedFunction: function() {
PageController.goToPage(PageEnum.PageSettingsBackup) PageController.goToPage(PageEnum.PageSettingsBackup)
} }
KeyNavigation.tab: about.rightButton
} }
DividerType {} DividerType {}
@@ -105,6 +116,7 @@ PageType {
clickedFunction: function() { clickedFunction: function() {
PageController.goToPage(PageEnum.PageSettingsAbout) PageController.goToPage(PageEnum.PageSettingsAbout)
} }
KeyNavigation.tab: root.defaultActiveFocusItem
} }
DividerType {} DividerType {}
@@ -13,6 +13,8 @@ import "../Components"
PageType { PageType {
id: root id: root
defaultActiveFocusItem: donateButton
BackButtonType { BackButtonType {
id: backButton id: backButton
@@ -74,6 +76,7 @@ PageType {
} }
BasicButtonType { BasicButtonType {
id: donateButton
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: 24 Layout.topMargin: 24
Layout.leftMargin: 16 Layout.leftMargin: 16
@@ -84,9 +87,12 @@ PageType {
clickedFunc: function() { clickedFunc: function() {
Qt.openUrlExternally(qsTr("https://www.patreon.com/amneziavpn")) Qt.openUrlExternally(qsTr("https://www.patreon.com/amneziavpn"))
} }
KeyNavigation.tab: donateButton2
} }
BasicButtonType { BasicButtonType {
id: donateButton2
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: 8 Layout.topMargin: 8
Layout.leftMargin: 16 Layout.leftMargin: 16
@@ -104,6 +110,8 @@ PageType {
clickedFunc: function() { clickedFunc: function() {
Qt.openUrlExternally(qsTr("https://github.com/amnezia-vpn/amnezia-client#donate")) Qt.openUrlExternally(qsTr("https://github.com/amnezia-vpn/amnezia-client#donate"))
} }
KeyNavigation.tab: donateButton
} }
ParagraphTextType { ParagraphTextType {
@@ -13,6 +13,8 @@ import "../Components"
PageType { PageType {
id: root id: root
defaultActiveFocusItem: languageLabel.rightButton
BackButtonType { BackButtonType {
id: backButton id: backButton
@@ -127,6 +129,7 @@ PageType {
} }
LabelWithButtonType { LabelWithButtonType {
id: languageLabel
Layout.fillWidth: true Layout.fillWidth: true
text: qsTr("Language") text: qsTr("Language")
@@ -136,12 +139,15 @@ PageType {
clickedFunction: function() { clickedFunction: function() {
selectLanguageDrawer.open() selectLanguageDrawer.open()
} }
KeyNavigation.tab: loggingLabel.rightButton
} }
DividerType {} DividerType {}
LabelWithButtonType { LabelWithButtonType {
id: loggingLabel
Layout.fillWidth: true Layout.fillWidth: true
text: qsTr("Logging") text: qsTr("Logging")
@@ -151,11 +157,14 @@ PageType {
clickedFunction: function() { clickedFunction: function() {
PageController.goToPage(PageEnum.PageSettingsLogging) PageController.goToPage(PageEnum.PageSettingsLogging)
} }
KeyNavigation.tab: resetLabel.rightButton
} }
DividerType {} DividerType {}
LabelWithButtonType { LabelWithButtonType {
id: resetLabel
Layout.fillWidth: true Layout.fillWidth: true
text: qsTr("Reset settings and remove all data from the application") text: qsTr("Reset settings and remove all data from the application")
@@ -171,12 +180,21 @@ PageType {
var yesButtonFunction = function() { var yesButtonFunction = function() {
SettingsController.clearSettings() SettingsController.clearSettings()
PageController.replaceStartPage() PageController.replaceStartPage()
if (!GC.isMobile()) {
languageLabel.rightButton.forceActiveFocus()
}
} }
var noButtonFunction = function() { var noButtonFunction = function() {
if (!GC.isMobile()) {
languageLabel.rightButton.forceActiveFocus()
}
} }
showQuestionDrawer(headerText, descriptionText, yesButtonText, noButtonText, yesButtonFunction, noButtonFunction) showQuestionDrawer(headerText, descriptionText, yesButtonText, noButtonText, yesButtonFunction, noButtonFunction)
} }
KeyNavigation.tab: defaultActiveFocusItem
} }
DividerType {} DividerType {}
@@ -34,6 +34,8 @@ PageType {
} }
} }
defaultActiveFocusItem: makeBackupButton
BackButtonType { BackButtonType {
id: backButton id: backButton
@@ -106,9 +108,12 @@ PageType {
PageController.showNotificationMessage(qsTr("Backup file saved")) PageController.showNotificationMessage(qsTr("Backup file saved"))
} }
} }
KeyNavigation.tab: restoreBackupButton
} }
BasicButtonType { BasicButtonType {
id: restoreBackupButton
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: -8 Layout.topMargin: -8
@@ -128,6 +133,8 @@ PageType {
restoreBackup(filePath) restoreBackup(filePath)
} }
} }
KeyNavigation.tab: makeBackupButton
} }
} }
} }
@@ -11,6 +11,8 @@ import "../Config"
PageType { PageType {
id: root id: root
defaultActiveFocusItem: dnsServersButton.rightButton
BackButtonType { BackButtonType {
id: backButton id: backButton
@@ -59,6 +61,7 @@ PageType {
DividerType {} DividerType {}
LabelWithButtonType { LabelWithButtonType {
id: dnsServersButton
Layout.fillWidth: true Layout.fillWidth: true
text: qsTr("DNS servers") text: qsTr("DNS servers")
@@ -68,11 +71,14 @@ PageType {
clickedFunction: function() { clickedFunction: function() {
PageController.goToPage(PageEnum.PageSettingsDns) PageController.goToPage(PageEnum.PageSettingsDns)
} }
KeyNavigation.tab: splitTunnelingButton.rightButton
} }
DividerType {} DividerType {}
LabelWithButtonType { LabelWithButtonType {
id: splitTunnelingButton
visible: true visible: true
Layout.fillWidth: true Layout.fillWidth: true
@@ -84,6 +90,7 @@ PageType {
clickedFunction: function() { clickedFunction: function() {
PageController.goToPage(PageEnum.PageSettingsSplitTunneling) PageController.goToPage(PageEnum.PageSettingsSplitTunneling)
} }
KeyNavigation.tab: splitTunnelingButton2.visible ? splitTunnelingButton2.rightButton : root.defaultActiveFocusItem
} }
DividerType { DividerType {
@@ -91,6 +98,7 @@ PageType {
} }
LabelWithButtonType { LabelWithButtonType {
id: splitTunnelingButton2
visible: false visible: false
Layout.fillWidth: true Layout.fillWidth: true
@@ -101,6 +109,7 @@ PageType {
clickedFunction: function() { clickedFunction: function() {
} }
KeyNavigation.tab: root.defaultActiveFocusItem
} }
DividerType { DividerType {
+10 -1
View File
@@ -87,10 +87,11 @@ PageType {
regularExpression: InstallController.ipAddressRegExp() regularExpression: InstallController.ipAddressRegExp()
} }
KeyNavigation.tab: saveButton KeyNavigation.tab: restoreDefaultButton
} }
BasicButtonType { BasicButtonType {
id: restoreDefaultButton
Layout.fillWidth: true Layout.fillWidth: true
defaultColor: "transparent" defaultColor: "transparent"
@@ -113,12 +114,19 @@ PageType {
SettingsController.secondaryDns = "1.0.0.1" SettingsController.secondaryDns = "1.0.0.1"
secondaryDns.textFieldText = SettingsController.secondaryDns secondaryDns.textFieldText = SettingsController.secondaryDns
PageController.showNotificationMessage(qsTr("Settings have been reset")) PageController.showNotificationMessage(qsTr("Settings have been reset"))
if (!GC.isMobile()) {
primaryDns.textField.forceActiveFocus()
}
} }
var noButtonFunction = function() { var noButtonFunction = function() {
if (!GC.isMobile()) {
primaryDns.textField.forceActiveFocus()
}
} }
showQuestionDrawer(headerText, "", yesButtonText, noButtonText, yesButtonFunction, noButtonFunction) showQuestionDrawer(headerText, "", yesButtonText, noButtonText, yesButtonFunction, noButtonFunction)
} }
KeyNavigation.tab: saveButton
} }
BasicButtonType { BasicButtonType {
@@ -137,6 +145,7 @@ PageType {
} }
PageController.showNotificationMessage(qsTr("Settings saved")) PageController.showNotificationMessage(qsTr("Settings saved"))
} }
KeyNavigation.tab: primaryDns.textField
} }
} }
} }
@@ -93,6 +93,7 @@ PageType {
Connections { Connections {
target: serverNameEditDrawer target: serverNameEditDrawer
enabled: !GC.isMobile()
function onOpened() { function onOpened() {
serverName.textField.forceActiveFocus() serverName.textField.forceActiveFocus()
} }
@@ -127,6 +128,8 @@ PageType {
} }
serverNameEditDrawer.close() serverNameEditDrawer.close()
} }
KeyNavigation.tab: serverName.textField
} }
Component.onCompleted: { Component.onCompleted: {
@@ -17,6 +17,8 @@ import "../Components"
PageType { PageType {
id: root id: root
defaultActiveFocusItem: servers.currentItem.focusItem
ColumnLayout { ColumnLayout {
id: header id: header
@@ -63,6 +65,8 @@ PageType {
implicitWidth: servers.width implicitWidth: servers.width
implicitHeight: delegateContent.implicitHeight implicitHeight: delegateContent.implicitHeight
property alias focusItem: server.rightButton
ColumnLayout { ColumnLayout {
id: delegateContent id: delegateContent
@@ -296,6 +296,14 @@ PageType {
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
Connections{
target: moreActionsDrawer
enabled: !GC.isMobile()
function onOpened(){
importSitesButton.rightButton.forceActiveFocus()
}
}
Header2Type { Header2Type {
Layout.fillWidth: true Layout.fillWidth: true
Layout.margins: 16 Layout.margins: 16
@@ -304,6 +312,7 @@ PageType {
} }
LabelWithButtonType { LabelWithButtonType {
id: importSitesButton
Layout.fillWidth: true Layout.fillWidth: true
text: qsTr("Import") text: qsTr("Import")
@@ -317,6 +326,7 @@ PageType {
DividerType {} DividerType {}
LabelWithButtonType { LabelWithButtonType {
id: saveSitesButton
Layout.fillWidth: true Layout.fillWidth: true
text: qsTr("Save site list") text: qsTr("Save site list")
@@ -13,6 +13,8 @@ import "../Config"
PageType { PageType {
id: root id: root
defaultActiveFocusItem:fileButton.rightButton
Connections { Connections {
target: ImportController target: ImportController
@@ -62,6 +64,7 @@ It's okay as long as it's from someone you trust.")
} }
LabelWithButtonType { LabelWithButtonType {
id: fileButton
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: 16 Layout.topMargin: 16
@@ -84,11 +87,14 @@ It's okay as long as it's from someone you trust.")
} }
} }
} }
KeyNavigation.tab: qrButton.visible ? qrButton.rightButton : textButton.rightButton
} }
DividerType {} DividerType {}
LabelWithButtonType { LabelWithButtonType {
id: qrButton
Layout.fillWidth: true Layout.fillWidth: true
visible: SettingsController.isCameraPresent() visible: SettingsController.isCameraPresent()
@@ -102,6 +108,8 @@ It's okay as long as it's from someone you trust.")
PageController.goToPage(PageEnum.PageSetupWizardQrReader) PageController.goToPage(PageEnum.PageSetupWizardQrReader)
} }
} }
KeyNavigation.tab: textButton.rightButton
} }
DividerType { DividerType {
@@ -109,6 +117,7 @@ It's okay as long as it's from someone you trust.")
} }
LabelWithButtonType { LabelWithButtonType {
id: textButton
Layout.fillWidth: true Layout.fillWidth: true
text: qsTr("Key as text") text: qsTr("Key as text")
@@ -118,6 +127,8 @@ It's okay as long as it's from someone you trust.")
clickedFunction: function() { clickedFunction: function() {
PageController.goToPage(PageEnum.PageSetupWizardTextKey) PageController.goToPage(PageEnum.PageSetupWizardTextKey)
} }
KeyNavigation.tab: defaultActiveFocusItem
} }
DividerType {} DividerType {}
@@ -121,6 +121,8 @@ PageType {
PageController.goToPage(PageEnum.PageSetupWizardEasy) PageController.goToPage(PageEnum.PageSetupWizardEasy)
} }
KeyNavigation.tab: hostname.textField
} }
LabelTextType { LabelTextType {
@@ -17,6 +17,8 @@ PageType {
property bool isEasySetup: true property bool isEasySetup: true
defaultActiveFocusItem: continueButton
SortFilterProxyModel { SortFilterProxyModel {
id: proxyContainersModel id: proxyContainersModel
sourceModel: ContainersModel sourceModel: ContainersModel
@@ -169,6 +171,7 @@ PageType {
PageController.goToPage(PageEnum.PageSetupWizardProtocols) PageController.goToPage(PageEnum.PageSetupWizardProtocols)
} }
} }
KeyNavigation.tab: setupLaterButton
} }
BasicButtonType { BasicButtonType {
@@ -200,6 +203,8 @@ PageType {
PageController.goToPage(PageEnum.PageSetupWizardInstalling) PageController.goToPage(PageEnum.PageSetupWizardInstalling)
InstallController.addEmptyServer() InstallController.addEmptyServer()
} }
KeyNavigation.tab: continueButton
} }
} }
} }
@@ -15,6 +15,8 @@ PageType {
property bool isControlsDisabled: false property bool isControlsDisabled: false
defaultActiveFocusItem: startButton
Connections { Connections {
target: PageController target: PageController
@@ -122,6 +124,7 @@ PageType {
} }
BasicButtonType { BasicButtonType {
id: startButton
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: 32 Layout.topMargin: 32
Layout.leftMargin: 16 Layout.leftMargin: 16
@@ -132,9 +135,11 @@ PageType {
clickedFunc: function() { clickedFunc: function() {
connectionTypeSelection.open() connectionTypeSelection.open()
} }
KeyNavigation.tab: startButton2
} }
BasicButtonType { BasicButtonType {
id: startButton2
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: 8 Layout.topMargin: 8
Layout.leftMargin: 16 Layout.leftMargin: 16
@@ -152,6 +157,7 @@ PageType {
clickedFunc: function() { clickedFunc: function() {
Qt.openUrlExternally(qsTr("https://amnezia.org/instructions/0_starter-guide")) Qt.openUrlExternally(qsTr("https://amnezia.org/instructions/0_starter-guide"))
} }
KeyNavigation.tab: startButton
} }
} }
} }
@@ -80,5 +80,6 @@ PageType {
ImportController.extractConfigFromCode(textKey.textFieldText) ImportController.extractConfigFromCode(textKey.textFieldText)
PageController.goToPage(PageEnum.PageSetupWizardViewConfig) PageController.goToPage(PageEnum.PageSetupWizardViewConfig)
} }
KeyNavigation.tab: textKey.textField
} }
} }
@@ -15,6 +15,8 @@ PageType {
property bool showContent: false property bool showContent: false
defaultActiveFocusItem: showContentButton
Connections { Connections {
target: ImportController target: ImportController
@@ -53,7 +55,7 @@ PageType {
id: fl id: fl
anchors.top: backButton.bottom anchors.top: backButton.bottom
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
contentHeight: content.implicitHeight + connectButton.implicitHeight contentHeight: content.implicitHeight + connectButtonLayout.implicitHeight
ColumnLayout { ColumnLayout {
id: content id: content
@@ -97,6 +99,7 @@ PageType {
} }
BasicButtonType { BasicButtonType {
id: showContentButton
Layout.topMargin: 16 Layout.topMargin: 16
Layout.leftMargin: -8 Layout.leftMargin: -8
implicitHeight: 32 implicitHeight: 32
@@ -112,6 +115,8 @@ PageType {
clickedFunc: function() { clickedFunc: function() {
showContent = !showContent showContent = !showContent
} }
KeyNavigation.tab: connectButton
} }
Rectangle { Rectangle {
@@ -138,7 +143,7 @@ PageType {
} }
ColumnLayout { ColumnLayout {
id: connectButton id: connectButtonLayout
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
anchors.left: parent.left anchors.left: parent.left
@@ -147,6 +152,7 @@ PageType {
anchors.leftMargin: 16 anchors.leftMargin: 16
BasicButtonType { BasicButtonType {
id: connectButton
Layout.fillWidth: true Layout.fillWidth: true
Layout.bottomMargin: 32 Layout.bottomMargin: 32
@@ -154,6 +160,8 @@ PageType {
clickedFunc: function() { clickedFunc: function() {
ImportController.importConfig() ImportController.importConfig()
} }
KeyNavigation.tab: defaultActiveFocusItem
} }
} }
} }
+33
View File
@@ -12,6 +12,7 @@ import "./"
import "../Controls2" import "../Controls2"
import "../Controls2/TextTypes" import "../Controls2/TextTypes"
import "../Components" import "../Components"
import "../Config"
PageType { PageType {
id: root id: root
@@ -181,6 +182,14 @@ PageType {
spacing: 0 spacing: 0
Connections {
target: shareFullAccessDrawer
enabled: !GC.isMobile()
function onOpened() {
shareFullAccessButton.rightButton.forceActiveFocus()
}
}
Header2Type { Header2Type {
Layout.fillWidth: true Layout.fillWidth: true
Layout.bottomMargin: 16 Layout.bottomMargin: 16
@@ -193,6 +202,7 @@ PageType {
LabelWithButtonType { LabelWithButtonType {
id: shareFullAccessButton
Layout.fillWidth: true Layout.fillWidth: true
text: qsTr("Share") text: qsTr("Share")
@@ -499,8 +509,12 @@ PageType {
clickedFunc: function(){ clickedFunc: function(){
if (clientNameTextField.textFieldText !== "") { if (clientNameTextField.textFieldText !== "") {
ExportController.generateConfig(root.connectionTypesModel[exportTypeSelector.currentIndex].type) ExportController.generateConfig(root.connectionTypesModel[exportTypeSelector.currentIndex].type)
} else{
clientNameTextField.textField.forceActiveFocus()
} }
} }
KeyNavigation.tab: clientNameTextField.textField
} }
Header2Type { Header2Type {
@@ -514,6 +528,7 @@ PageType {
actionButtonImage: "qrc:/images/controls/search.svg" actionButtonImage: "qrc:/images/controls/search.svg"
actionButtonFunction: function() { actionButtonFunction: function() {
root.isSearchBarVisible = true root.isSearchBarVisible = true
searchTextField.textField.forceActiveFocus()
} }
} }
@@ -575,6 +590,7 @@ PageType {
anchors.leftMargin: -16 anchors.leftMargin: -16
LabelWithButtonType { LabelWithButtonType {
id: clientItem
Layout.fillWidth: true Layout.fillWidth: true
text: clientName text: clientName
@@ -605,6 +621,14 @@ PageType {
spacing: 8 spacing: 8
Connections {
target: clientInfoDrawer
enabled: !GC.isMobile()
function onOpened() {
renameButton.forceActiveFocus()
}
}
Header2Type { Header2Type {
Layout.fillWidth: true Layout.fillWidth: true
Layout.bottomMargin: 24 Layout.bottomMargin: 24
@@ -614,6 +638,7 @@ PageType {
} }
BasicButtonType { BasicButtonType {
id: renameButton
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: 24 Layout.topMargin: 24
@@ -648,6 +673,7 @@ PageType {
Connections { Connections {
target: clientNameEditDrawer target: clientNameEditDrawer
enabled: !GC.isMobile()
function onOpened() { function onOpened() {
clientNameEditor.textField.forceActiveFocus() clientNameEditor.textField.forceActiveFocus()
} }
@@ -686,12 +712,17 @@ PageType {
clientNameEditDrawer.close() clientNameEditDrawer.close()
} }
} }
KeyNavigation.tab: clientNameEditor.textField
} }
} }
} }
KeyNavigation.tab: revokeButton
} }
BasicButtonType { BasicButtonType {
id: revokeButton
Layout.fillWidth: true Layout.fillWidth: true
defaultColor: "transparent" defaultColor: "transparent"
@@ -718,6 +749,8 @@ PageType {
showQuestionDrawer(headerText, descriptionText, yesButtonText, noButtonText, yesButtonFunction, noButtonFunction) showQuestionDrawer(headerText, descriptionText, yesButtonText, noButtonText, yesButtonFunction, noButtonFunction)
} }
KeyNavigation.tab: renameButton
} }
} }
} }
@@ -16,6 +16,8 @@ import "../Components"
PageType { PageType {
id: root id: root
defaultActiveFocusItem: shareButton
BackButtonType { BackButtonType {
id: backButton id: backButton
@@ -117,6 +119,7 @@ PageType {
} }
BasicButtonType { BasicButtonType {
id: shareButton
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: 40 Layout.topMargin: 40