add focusController class

This commit is contained in:
Cyril Anisimov 2024-09-14 19:42:55 +02:00
parent 8547de82ea
commit 02bbcd3a31
76 changed files with 1906 additions and 1576 deletions

View file

@ -16,13 +16,6 @@ import "../Components"
PageType {
id: root
defaultActiveFocusItem: focusItem
Item {
id: focusItem
KeyNavigation.tab: backButton
}
ColumnLayout {
id: backButtonLayout
@ -34,7 +27,6 @@ PageType {
BackButtonType {
id: backButton
// KeyNavigation.tab: removeButton
}
}
@ -61,7 +53,6 @@ PageType {
headerText: "Dev menu"
}
TextFieldWithHeaderType {
id: passwordTextField
@ -86,8 +77,6 @@ PageType {
SettingsController.gatewayEndpoint = textFieldText
}
}
// KeyNavigation.tab: saveButton
}
SwitcherType {

View file

@ -19,13 +19,13 @@ import "../Components"
PageType {
id: root
defaultActiveFocusItem: focusItem
Connections {
objectName: "pageControllerConnections"
target: PageController
function onRestorePageHomeState(isContainerInstalled) {
drawer.open()
drawer.openTriggered()
if (isContainerInstalled) {
containersDropDown.rootButtonClickedFunction()
}
@ -33,23 +33,22 @@ PageType {
}
Item {
objectName: "homeColumnItem"
anchors.fill: parent
anchors.bottomMargin: drawer.collapsedHeight
ColumnLayout {
objectName: "homeColumnLayout"
anchors.fill: parent
anchors.topMargin: 34
anchors.bottomMargin: 34
Item {
id: focusItem
KeyNavigation.tab: loggingButton.visible ?
loggingButton :
connectButton
}
BasicButtonType {
id: loggingButton
objectName: "loggingButton"
property bool isLoggingEnabled: SettingsController.isLoggingEnabled
Layout.alignment: Qt.AlignHCenter
@ -69,8 +68,6 @@ PageType {
Keys.onEnterPressed: loggingButton.clicked()
Keys.onReturnPressed: loggingButton.clicked()
KeyNavigation.tab: connectButton
onClicked: {
PageController.goToPage(PageEnum.PageSettingsLogging)
}
@ -78,13 +75,15 @@ PageType {
ConnectButton {
id: connectButton
objectName: "connectButton"
Layout.fillHeight: true
Layout.alignment: Qt.AlignCenter
KeyNavigation.tab: splitTunnelingButton
}
BasicButtonType {
id: splitTunnelingButton
objectName: "splitTunnelingButton"
Layout.alignment: Qt.AlignHCenter | Qt.AlignBottom
Layout.bottomMargin: 34
@ -115,53 +114,47 @@ PageType {
Keys.onEnterPressed: splitTunnelingButton.clicked()
Keys.onReturnPressed: splitTunnelingButton.clicked()
KeyNavigation.tab: drawer
onClicked: {
homeSplitTunnelingDrawer.open()
homeSplitTunnelingDrawer.openTriggered()
}
HomeSplitTunnelingDrawer {
id: homeSplitTunnelingDrawer
objectName: "homeSplitTunnelingDrawer"
parent: root
onClosed: {
if (!GC.isMobile()) {
focusItem.forceActiveFocus()
}
console.log(objectName, " was closed...")
FocusController.setRootItem(null)
}
}
}
}
}
DrawerType2 {
id: drawer
objectName: "drawerProtocol"
anchors.fill: parent
onClosed: {
if (!GC.isMobile()) {
focusItem.forceActiveFocus()
}
}
collapsedStateContent: Item {
objectName: "ProtocolDrawerCollapsedContent"
collapsedContent: Item {
implicitHeight: Qt.platform.os !== "ios" ? root.height * 0.9 : screen.height * 0.77
Component.onCompleted: {
drawer.expandedHeight = implicitHeight
}
Connections {
objectName: "drawerConnections"
target: drawer
enabled: !GC.isMobile()
function onActiveFocusChanged() {
if (drawer.activeFocus && !drawer.isOpened) {
collapsedButtonChevron.forceActiveFocus()
}
}
}
ColumnLayout {
id: collapsed
objectName: "collapsedColumnLayout"
anchors.left: parent.left
anchors.right: parent.right
@ -180,6 +173,8 @@ PageType {
}
RowLayout {
objectName: "rowLayout"
Layout.topMargin: 14
Layout.leftMargin: 24
Layout.rightMargin: 24
@ -188,9 +183,11 @@ PageType {
spacing: 0
Connections {
objectName: "drawerConnections"
target: drawer
function onEntered() {
if (drawer.isCollapsed) {
function onCursorEntered() {
if (drawer.isCollapsedStateActive) {
collapsedButtonChevron.backgroundColor = collapsedButtonChevron.hoveredColor
collapsedButtonHeader.opacity = 0.8
} else {
@ -198,8 +195,8 @@ PageType {
}
}
function onExited() {
if (drawer.isCollapsed) {
function onCursorExited() {
if (drawer.isCollapsedStateActive) {
collapsedButtonChevron.backgroundColor = collapsedButtonChevron.defaultColor
collapsedButtonHeader.opacity = 1
} else {
@ -208,7 +205,7 @@ PageType {
}
function onPressed(pressed, entered) {
if (drawer.isCollapsed) {
if (drawer.isCollapsedStateActive) {
collapsedButtonChevron.backgroundColor = pressed ? collapsedButtonChevron.pressedColor : entered ? collapsedButtonChevron.hoveredColor : collapsedButtonChevron.defaultColor
collapsedButtonHeader.opacity = 0.7
} else {
@ -219,6 +216,8 @@ PageType {
Header1TextType {
id: collapsedButtonHeader
objectName: "collapsedButtonHeader"
Layout.maximumWidth: drawer.width - 48 - 18 - 12
maximumLineCount: 2
@ -227,8 +226,6 @@ PageType {
text: ServersModel.defaultServerName
horizontalAlignment: Qt.AlignHCenter
KeyNavigation.tab: tabBar
Behavior on opacity {
PropertyAnimation { duration: 200 }
}
@ -236,10 +233,11 @@ PageType {
ImageButtonType {
id: collapsedButtonChevron
objectName: "collapsedButtonChevron"
Layout.leftMargin: 8
visible: drawer.isCollapsed
visible: drawer.isCollapsedStateActive()
hoverEnabled: false
image: "qrc:/images/controls/chevron-down.svg"
@ -254,18 +252,19 @@ PageType {
Keys.onEnterPressed: collapsedButtonChevron.clicked()
Keys.onReturnPressed: collapsedButtonChevron.clicked()
Keys.onTabPressed: lastItemTabClicked()
onClicked: {
if (drawer.isCollapsed) {
drawer.open()
console.debug("onClicked collapsedButtonChevron")
if (drawer.isCollapsedStateActive()) {
drawer.openTriggered()
FocusController.setRootItem(drawer)
}
}
}
}
RowLayout {
objectName: "rowLayoutLabel"
Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
Layout.topMargin: 8
Layout.bottomMargin: drawer.isCollapsed ? 44 : ServersModel.isDefaultServerFromApi ? 61 : 16
@ -316,6 +315,7 @@ PageType {
ColumnLayout {
id: serversMenuHeader
objectName: "serversMenuHeader"
anchors.top: collapsed.bottom
anchors.right: parent.right
@ -327,13 +327,9 @@ PageType {
visible: !ServersModel.isDefaultServerFromApi
Item {
id: focusItem1
KeyNavigation.tab: containersDropDown
}
DropDownType {
id: containersDropDown
objectName: "containersDropDown"
rootButtonImageColor: AmneziaStyle.color.midnightBlack
rootButtonBackgroundColor: AmneziaStyle.color.paleGray
@ -350,22 +346,23 @@ PageType {
headerBackButtonImage: "qrc:/images/controls/arrow-left.svg"
rootButtonClickedFunction: function() {
containersDropDown.open()
containersDropDown.openTriggered()
}
drawerParent: root
KeyNavigation.tab: serversMenuContent
listView: HomeContainersListView {
id: containersListView
objectName: "containersListView"
rootWidth: root.width
onVisibleChanged: {
if (containersDropDown.visible && !GC.isMobile()) {
focusItem1.forceActiveFocus()
}
}
height: 500 // TODO: make calculated
// isFocusable: false // TODO: this is a workaround. Need to remove it
Connections {
objectName: "rowLayoutConnections"
target: ServersModel
function onDefaultServerIndexChanged() {
@ -407,169 +404,12 @@ PageType {
ButtonGroup {
id: serversRadioButtonGroup
objectName: "serversRadioButtonGroup"
}
ListView {
ServersListView {
id: serversMenuContent
anchors.top: serversMenuHeader.bottom
anchors.right: parent.right
anchors.left: parent.left
anchors.bottom: parent.bottom
anchors.topMargin: 16
model: ServersModel
currentIndex: ServersModel.defaultIndex
ScrollBar.vertical: ScrollBar {
id: scrollBar
policy: serversMenuContent.height >= serversMenuContent.contentHeight ? ScrollBar.AlwaysOff : ScrollBar.AlwaysOn
}
activeFocusOnTab: true
focus: true
property int focusItemIndex: 0
onActiveFocusChanged: {
if (activeFocus) {
serversMenuContent.focusItemIndex = 0
serversMenuContent.itemAtIndex(focusItemIndex).forceActiveFocus()
}
}
onFocusItemIndexChanged: {
const focusedElement = serversMenuContent.itemAtIndex(focusItemIndex)
if (focusedElement) {
if (focusedElement.y + focusedElement.height > serversMenuContent.height) {
serversMenuContent.contentY = focusedElement.y + focusedElement.height - serversMenuContent.height
} else {
serversMenuContent.contentY = 0
}
}
}
Keys.onUpPressed: scrollBar.decrease()
Keys.onDownPressed: scrollBar.increase()
Connections {
target: drawer
enabled: !GC.isMobile()
function onIsCollapsedChanged() {
if (drawer.isCollapsed) {
const item = serversMenuContent.itemAtIndex(serversMenuContent.focusItemIndex)
if (item) { item.serverRadioButtonProperty.focus = false }
}
}
}
Connections {
target: ServersModel
function onDefaultServerIndexChanged(serverIndex) {
serversMenuContent.currentIndex = serverIndex
}
}
clip: true
delegate: Item {
id: menuContentDelegate
property variant delegateData: model
property VerticalRadioButton serverRadioButtonProperty: serverRadioButton
implicitWidth: serversMenuContent.width
implicitHeight: serverRadioButtonContent.implicitHeight
onActiveFocusChanged: {
if (activeFocus) {
serverRadioButton.forceActiveFocus()
}
}
ColumnLayout {
id: serverRadioButtonContent
anchors.fill: parent
anchors.rightMargin: 16
anchors.leftMargin: 16
spacing: 0
RowLayout {
Layout.fillWidth: true
VerticalRadioButton {
id: serverRadioButton
Layout.fillWidth: true
text: name
descriptionText: serverDescription
checked: index === serversMenuContent.currentIndex
checkable: !ConnectionController.isConnected
ButtonGroup.group: serversRadioButtonGroup
onClicked: {
if (ConnectionController.isConnected) {
PageController.showNotificationMessage(qsTr("Unable change server while there is an active connection"))
return
}
serversMenuContent.currentIndex = index
ServersModel.defaultIndex = index
}
MouseArea {
anchors.fill: serverRadioButton
cursorShape: Qt.PointingHandCursor
enabled: false
}
Keys.onTabPressed: serverInfoButton.forceActiveFocus()
Keys.onEnterPressed: serverRadioButton.clicked()
Keys.onReturnPressed: serverRadioButton.clicked()
}
ImageButtonType {
id: serverInfoButton
image: "qrc:/images/controls/settings.svg"
imageColor: AmneziaStyle.color.paleGray
implicitWidth: 56
implicitHeight: 56
z: 1
Keys.onTabPressed: {
if (serversMenuContent.focusItemIndex < serversMenuContent.count - 1) {
serversMenuContent.focusItemIndex++
serversMenuContent.itemAtIndex(serversMenuContent.focusItemIndex).forceActiveFocus()
} else {
focusItem1.forceActiveFocus()
serversMenuContent.contentY = 0
}
}
Keys.onEnterPressed: serverInfoButton.clicked()
Keys.onReturnPressed: serverInfoButton.clicked()
onClicked: function() {
ServersModel.processedIndex = index
PageController.goToPage(PageEnum.PageSettingsServerInfo)
drawer.close()
}
}
}
DividerType {
Layout.fillWidth: true
Layout.leftMargin: 0
Layout.rightMargin: 0
}
}
}
objectName: "serversMenuContent"
}
}
}

View file

@ -17,18 +17,6 @@ import "../Components"
PageType {
id: root
defaultActiveFocusItem: listview.currentItem.portTextField.textField
Item {
id: focusItem
onFocusChanged: {
if (activeFocus) {
fl.ensureVisible(focusItem)
}
}
KeyNavigation.tab: backButton
}
ColumnLayout {
id: backButtonLayout
@ -40,7 +28,6 @@ PageType {
BackButtonType {
id: backButton
KeyNavigation.tab: listview.currentItem.portTextField.textField
}
}
@ -114,8 +101,26 @@ PageType {
}
checkEmptyText: true
}
KeyNavigation.tab: junkPacketCountTextField.textField
TextFieldWithHeaderType {
id: mtuTextField
Layout.fillWidth: true
Layout.topMargin: 16
headerText: qsTr("MTU")
textFieldText: mtu
textField.validator: IntValidator { bottom: 576; top: 65535 }
textField.onEditingFinished: {
if (textFieldText === "") {
textFieldText = "0"
}
if (textFieldText !== mtu) {
mtu = textFieldText
}
}
checkEmptyText: true
}
TextFieldWithHeaderType {
@ -139,8 +144,6 @@ PageType {
}
checkEmptyText: true
KeyNavigation.tab: junkPacketMinSizeTextField.textField
}
TextFieldWithHeaderType {
@ -160,8 +163,6 @@ PageType {
}
checkEmptyText: true
KeyNavigation.tab: junkPacketMaxSizeTextField.textField
}
TextFieldWithHeaderType {
@ -181,8 +182,6 @@ PageType {
}
checkEmptyText: true
KeyNavigation.tab: initPacketJunkSizeTextField.textField
}
TextFieldWithHeaderType {
@ -202,8 +201,6 @@ PageType {
}
checkEmptyText: true
KeyNavigation.tab: responsePacketJunkSizeTextField.textField
}
TextFieldWithHeaderType {
@ -223,8 +220,6 @@ PageType {
}
checkEmptyText: true
KeyNavigation.tab: initPacketMagicHeaderTextField.textField
}
TextFieldWithHeaderType {
@ -244,8 +239,6 @@ PageType {
}
checkEmptyText: true
KeyNavigation.tab: responsePacketMagicHeaderTextField.textField
}
TextFieldWithHeaderType {
@ -265,8 +258,6 @@ PageType {
}
checkEmptyText: true
KeyNavigation.tab: transportPacketMagicHeaderTextField.textField
}
TextFieldWithHeaderType {
@ -286,8 +277,6 @@ PageType {
}
checkEmptyText: true
KeyNavigation.tab: underloadPacketMagicHeaderTextField.textField
}
TextFieldWithHeaderType {
@ -307,8 +296,6 @@ PageType {
}
checkEmptyText: true
KeyNavigation.tab: saveRestartButton
}
BasicButtonType {
@ -332,8 +319,6 @@ PageType {
text: qsTr("Save")
Keys.onTabPressed: lastItemTabClicked(focusItem)
clickedFunc: function() {
forceActiveFocus()

View file

@ -16,13 +16,6 @@ import "../Components"
PageType {
id: root
defaultActiveFocusItem: listview.currentItem.trafficFromField.textField
Item {
id: focusItem
KeyNavigation.tab: backButton
}
ColumnLayout {
id: backButtonLayout
@ -34,7 +27,6 @@ PageType {
BackButtonType {
id: backButton
KeyNavigation.tab: listview.currentItem.trafficFromField.textField
}
}
@ -110,8 +102,6 @@ PageType {
}
}
}
KeyNavigation.tab: portTextField.textField
}
TextFieldWithHeaderType {
@ -130,8 +120,6 @@ PageType {
port = textFieldText
}
}
KeyNavigation.tab: cipherDropDown
}
DropDownType {
@ -143,7 +131,6 @@ PageType {
headerText: qsTr("Cipher")
drawerParent: root
KeyNavigation.tab: saveRestartButton
listView: ListViewWithRadioButtonType {
id: cipherListView

View file

@ -17,18 +17,6 @@ import "../Components"
PageType {
id: root
defaultActiveFocusItem: listview.currentItem.vpnAddressSubnetTextField.textField
Item {
id: focusItem
KeyNavigation.tab: backButton
onActiveFocusChanged: {
if (activeFocus) {
fl.ensureVisible(focusItem)
}
}
}
ColumnLayout {
id: backButtonLayout
@ -40,7 +28,6 @@ PageType {
BackButtonType {
id: backButton
KeyNavigation.tab: listview.currentItem.vpnAddressSubnetTextField.textField
}
}
@ -104,7 +91,6 @@ PageType {
textFieldText: subnetAddress
parentFlickable: fl
KeyNavigation.tab: transportProtoSelector
textField.onEditingFinished: {
if (textFieldText !== subnetAddress) {
@ -132,8 +118,6 @@ PageType {
return transportProto === "tcp" ? 1 : 0
}
KeyNavigation.tab: portTextField.enabled ? portTextField.textField : autoNegotiateEncryprionSwitcher
onCurrentIndexChanged: {
if (transportProto === "tcp" && currentIndex === 0) {
transportProto = "udp"
@ -162,8 +146,6 @@ PageType {
port = textFieldText
}
}
KeyNavigation.tab: autoNegotiateEncryprionSwitcher
}
SwitcherType {
@ -181,10 +163,6 @@ PageType {
autoNegotiateEncryprion = checked
}
}
KeyNavigation.tab: hashDropDown.enabled ?
hashDropDown :
tlsAuthCheckBox
}
DropDownType {
@ -199,9 +177,6 @@ PageType {
drawerParent: root
parentFlickable: fl
KeyNavigation.tab: cipherDropDown.enabled ?
cipherDropDown :
tlsAuthCheckBox
listView: ListViewWithRadioButtonType {
id: hashListView
@ -252,8 +227,6 @@ PageType {
drawerParent: root
parentFlickable: fl
KeyNavigation.tab: tlsAuthCheckBox
listView: ListViewWithRadioButtonType {
id: cipherListView
@ -320,8 +293,6 @@ PageType {
text: qsTr("TLS auth")
checked: tlsAuth
KeyNavigation.tab: blockDnsCheckBox
onCheckedChanged: {
if (checked !== tlsAuth) {
console.log("tlsAuth changed to: " + checked)
@ -339,8 +310,6 @@ PageType {
text: qsTr("Block DNS requests outside of VPN")
checked: blockDns
KeyNavigation.tab: additionalClientCommandsSwitcher
onCheckedChanged: {
if (checked !== blockDns) {
blockDns = checked
@ -355,9 +324,6 @@ PageType {
Layout.fillWidth: true
Layout.topMargin: 32
parentFlickable: fl
KeyNavigation.tab: additionalClientCommandsTextArea.visible ?
additionalClientCommandsTextArea.textArea :
additionalServerCommandsSwitcher
checked: additionalClientCommands !== ""
@ -376,7 +342,7 @@ PageType {
Layout.topMargin: 16
visible: additionalClientCommandsSwitcher.checked
KeyNavigation.tab: additionalServerCommandsSwitcher
parentFlickable: fl
textAreaText: additionalClientCommands
@ -394,9 +360,6 @@ PageType {
Layout.fillWidth: true
Layout.topMargin: 16
parentFlickable: fl
KeyNavigation.tab: additionalServerCommandsTextArea.visible ?
additionalServerCommandsTextArea.textArea :
saveRestartButton
checked: additionalServerCommands !== ""
@ -419,7 +382,6 @@ PageType {
textAreaText: additionalServerCommands
placeholderText: qsTr("Commands:")
parentFlickable: fl
KeyNavigation.tab: saveRestartButton
textArea.onEditingFinished: {
if (additionalServerCommands !== textAreaText) {
additionalServerCommands = textAreaText

View file

@ -19,13 +19,6 @@ import "../Components"
PageType {
id: root
defaultActiveFocusItem: focusItem
Item {
id: focusItem
KeyNavigation.tab: backButton
}
ColumnLayout {
id: header
@ -37,7 +30,6 @@ PageType {
BackButtonType {
id: backButton
KeyNavigation.tab: listView
}
HeaderType {
@ -104,8 +96,6 @@ PageType {
configContentDrawer.open()
}
KeyNavigation.tab: removeButton
MouseArea {
anchors.fill: button
cursorShape: Qt.PointingHandCursor
@ -129,7 +119,7 @@ PageType {
parent: root
anchors.fill: parent
expandedContent: Item {
expandedStateContent: Item {
implicitHeight: configContentDrawer.expandedHeight
Connections {
@ -140,11 +130,6 @@ PageType {
}
}
Item {
id: focusItem1
KeyNavigation.tab: backButton1
}
BackButtonType {
id: backButton1
@ -156,8 +141,6 @@ PageType {
backButtonFunction: function() {
configContentDrawer.close()
}
KeyNavigation.tab: focusItem1
}
FlickableType {

View file

@ -16,15 +16,6 @@ import "../Components"
PageType {
id: root
defaultActiveFocusItem: listview.currentItem.focusItemId.enabled ?
listview.currentItem.focusItemId.textField :
focusItem
Item {
id: focusItem
KeyNavigation.tab: backButton
}
ColumnLayout {
id: backButtonLayout
@ -36,9 +27,6 @@ PageType {
BackButtonType {
id: backButton
KeyNavigation.tab: listview.currentItem.focusItemId.enabled ?
listview.currentItem.focusItemId.textField :
focusItem
}
}
@ -114,8 +102,6 @@ PageType {
port = textFieldText
}
}
KeyNavigation.tab: cipherDropDown
}
DropDownType {
@ -129,9 +115,9 @@ PageType {
headerText: qsTr("Cipher")
drawerParent: root
KeyNavigation.tab: saveRestartButton
listView: ListViewWithRadioButtonType {
id: cipherListView
rootWidth: root.width

View file

@ -16,13 +16,6 @@ import "../Components"
PageType {
id: root
defaultActiveFocusItem: listview
Item {
id: focusItem
KeyNavigation.tab: backButton
}
ColumnLayout {
id: backButtonLayout
@ -34,7 +27,6 @@ PageType {
BackButtonType {
id: backButton
KeyNavigation.tab: listview
}
}
@ -64,12 +56,12 @@ PageType {
model: WireGuardConfigModel
activeFocusOnTab: true
onActiveFocusChanged: {
if (activeFocus) {
listview.itemAtIndex(0)?.focusItemId.forceActiveFocus()
}
}
// activeFocusOnTab: true
// onActiveFocusChanged: {
// if (activeFocus) {
// listview.itemAtIndex(0)?.focusItemId.forceActiveFocus()
// }
// }
delegate: Item {
id: delegateItem
@ -109,8 +101,6 @@ PageType {
textField.maximumLength: 5
textField.validator: IntValidator { bottom: 1; top: 65535 }
KeyNavigation.tab: saveButton
textField.onEditingFinished: {
if (textFieldText !== port) {
port = textFieldText
@ -120,6 +110,26 @@ PageType {
checkEmptyText: true
}
TextFieldWithHeaderType {
id: mtuTextField
Layout.fillWidth: true
Layout.topMargin: 16
headerText: qsTr("MTU")
textFieldText: mtu
textField.validator: IntValidator { bottom: 576; top: 65535 }
textField.onEditingFinished: {
if (textFieldText === "") {
textFieldText = "0"
}
if (textFieldText !== mtu) {
mtu = textFieldText
}
}
checkEmptyText: true
}
BasicButtonType {
id: saveButton
Layout.fillWidth: true

View file

@ -17,13 +17,6 @@ import "../Components"
PageType {
id: root
defaultActiveFocusItem: listview
Item {
id: focusItem
KeyNavigation.tab: backButton
}
ColumnLayout {
id: backButtonLayout
@ -35,7 +28,6 @@ PageType {
BackButtonType {
id: backButton
KeyNavigation.tab: listview
}
}
@ -65,12 +57,12 @@ PageType {
model: XrayConfigModel
activeFocusOnTab: true
onActiveFocusChanged: {
if (activeFocus) {
listview.itemAtIndex(0)?.focusItemId.forceActiveFocus()
}
}
// activeFocusOnTab: true
// onActiveFocusChanged: {
// if (activeFocus) {
// listview.itemAtIndex(0)?.focusItemId.forceActiveFocus()
// }
// }
delegate: Item {
property alias focusItemId: textFieldWithHeaderType.textField
@ -103,8 +95,6 @@ PageType {
headerText: qsTr("Disguised as traffic from")
textFieldText: site
KeyNavigation.tab: basicButton
textField.onEditingFinished: {
if (textFieldText !== site) {
var tmpText = textFieldText

View file

@ -16,13 +16,6 @@ import "../Components"
PageType {
id: root
defaultActiveFocusItem: focusItem
Item {
id: focusItem
KeyNavigation.tab: backButton
}
ColumnLayout {
id: backButtonLayout
@ -34,7 +27,6 @@ PageType {
BackButtonType {
id: backButton
KeyNavigation.tab: removeButton
}
}

View file

@ -16,8 +16,6 @@ import "../Components"
PageType {
id: root
defaultActiveFocusItem: focusItem
Connections {
target: InstallController
@ -26,11 +24,6 @@ PageType {
}
}
Item {
id: focusItem
KeyNavigation.tab: backButton
}
ColumnLayout {
id: backButtonLayout
@ -42,7 +35,6 @@ PageType {
BackButtonType {
id: backButton
KeyNavigation.tab: listview
}
}
@ -107,7 +99,6 @@ PageType {
Layout.topMargin: 32
parentFlickable: fl
KeyNavigation.tab: portLabel.rightButton
text: qsTr("Host")
descriptionText: ServersModel.getProcessedServerData("hostName")
@ -136,7 +127,6 @@ PageType {
descriptionOnTop: true
parentFlickable: fl
KeyNavigation.tab: usernameLabel.rightButton
rightImageSource: "qrc:/images/controls/copy.svg"
rightImageColor: AmneziaStyle.color.paleGray
@ -160,7 +150,6 @@ PageType {
descriptionOnTop: true
parentFlickable: fl
KeyNavigation.tab: passwordLabel.eyeButton
rightImageSource: "qrc:/images/controls/copy.svg"
rightImageColor: AmneziaStyle.color.paleGray
@ -184,7 +173,7 @@ PageType {
descriptionOnTop: true
parentFlickable: fl
eyeButton.KeyNavigation.tab: passwordLabel.rightButton
rightButton.Keys.onTabPressed: {
if (mountButton.visible) {
mountButton.forceActiveFocus()
@ -225,7 +214,6 @@ PageType {
borderWidth: 1
parentFlickable: fl
KeyNavigation.tab: detailedInstructionsButton
text: qsTr("Mount folder on device")

View file

@ -17,8 +17,6 @@ import "../Components"
PageType {
id: root
defaultActiveFocusItem: listview
Connections {
target: InstallController
@ -27,11 +25,6 @@ PageType {
}
}
Item {
id: focusItem
KeyNavigation.tab: backButton
}
ColumnLayout {
id: backButtonLayout
@ -43,7 +36,6 @@ PageType {
BackButtonType {
id: backButton
KeyNavigation.tab: listview
}
}
@ -99,7 +91,6 @@ PageType {
Layout.topMargin: 32
parentFlickable: fl
KeyNavigation.tab: portLabel.rightButton
text: qsTr("Host")
descriptionText: ServersModel.getProcessedServerData("hostName")
@ -128,7 +119,6 @@ PageType {
descriptionOnTop: true
parentFlickable: fl
KeyNavigation.tab: usernameLabel.rightButton
rightImageSource: "qrc:/images/controls/copy.svg"
rightImageColor: AmneziaStyle.color.paleGray
@ -152,7 +142,6 @@ PageType {
descriptionOnTop: true
parentFlickable: fl
KeyNavigation.tab: passwordLabel.eyeButton
rightImageSource: "qrc:/images/controls/copy.svg"
rightImageColor: AmneziaStyle.color.paleGray
@ -176,8 +165,6 @@ PageType {
descriptionOnTop: true
parentFlickable: fl
eyeButton.KeyNavigation.tab: passwordLabel.rightButton
rightButton.KeyNavigation.tab: changeSettingsButton
rightImageSource: "qrc:/images/controls/copy.svg"
rightImageColor: AmneziaStyle.color.paleGray
@ -206,7 +193,7 @@ PageType {
}
}
expandedContent: ColumnLayout {
expandedStateContent: ColumnLayout {
property string tempPort: port
property string tempUsername: username
property string tempPassword: password
@ -239,11 +226,6 @@ PageType {
}
}
Item {
id: drawerFocusItem
KeyNavigation.tab: portTextField.textField
}
HeaderType {
Layout.fillWidth: true
@ -268,8 +250,6 @@ PageType {
port = textFieldText
}
}
KeyNavigation.tab: usernameTextField.textField
}
TextFieldWithHeaderType {
@ -290,8 +270,6 @@ PageType {
username = textFieldText
}
}
KeyNavigation.tab: passwordTextField.textField
}
TextFieldWithHeaderType {
@ -322,8 +300,6 @@ PageType {
password = textFieldText
}
}
KeyNavigation.tab: saveButton
}
BasicButtonType {

View file

@ -17,8 +17,6 @@ import "../Components"
PageType {
id: root
defaultActiveFocusItem: focusItem
Connections {
target: InstallController
@ -27,11 +25,6 @@ PageType {
}
}
Item {
id: focusItem
KeyNavigation.tab: backButton
}
ColumnLayout {
id: backButtonLayout
@ -43,7 +36,6 @@ PageType {
BackButtonType {
id: backButton
KeyNavigation.tab: websiteName.rightButton
}
}

View file

@ -14,9 +14,7 @@ import "../Config"
PageType {
id: root
defaultActiveFocusItem: header
FlickableType {
FlickableType { // TODO: refactor either replace with ListView or Repeater
id: fl
anchors.top: parent.top
anchors.bottom: parent.bottom
@ -39,8 +37,6 @@ PageType {
Layout.leftMargin: 16
headerText: qsTr("Settings")
KeyNavigation.tab: account.rightButton
}
LabelWithButtonType {
@ -55,8 +51,6 @@ PageType {
clickedFunction: function() {
PageController.goToPage(PageEnum.PageSettingsServersList)
}
KeyNavigation.tab: connection.rightButton
}
DividerType {}
@ -72,8 +66,6 @@ PageType {
clickedFunction: function() {
PageController.goToPage(PageEnum.PageSettingsConnection)
}
KeyNavigation.tab: application.rightButton
}
DividerType {}
@ -89,8 +81,6 @@ PageType {
clickedFunction: function() {
PageController.goToPage(PageEnum.PageSettingsApplication)
}
KeyNavigation.tab: backup.rightButton
}
DividerType {}
@ -106,8 +96,6 @@ PageType {
clickedFunction: function() {
PageController.goToPage(PageEnum.PageSettingsBackup)
}
KeyNavigation.tab: about.rightButton
}
DividerType {}
@ -123,8 +111,6 @@ PageType {
clickedFunction: function() {
PageController.goToPage(PageEnum.PageSettingsAbout)
}
KeyNavigation.tab: close
}
DividerType {}
@ -138,8 +124,6 @@ PageType {
rightImageSource: "qrc:/images/controls/chevron-right.svg"
leftImageSource: "qrc:/images/controls/bug.svg"
// Keys.onTabPressed: lastItemTabClicked(header)
clickedFunction: function() {
PageController.goToPage(PageEnum.PageDevMenu)
}
@ -156,10 +140,9 @@ PageType {
Layout.preferredHeight: about.height
text: qsTr("Close application")
rightImageSource: "qrc:/images/controls/chevron-right.svg"
leftImageSource: "qrc:/images/controls/x-circle.svg"
isLeftImageHoverEnabled: false
Keys.onTabPressed: lastItemTabClicked(header)
// isLeftImageHoverEnabled: false
clickedFunction: function() {
PageController.closeApplication()

View file

@ -14,18 +14,16 @@ import "../Components"
PageType {
id: root
defaultActiveFocusItem: focusItem
// Item {
// id: focusItem
// KeyNavigation.tab: backButton
Item {
id: focusItem
KeyNavigation.tab: backButton
onFocusChanged: {
if (focusItem.activeFocus) {
fl.contentY = 0
}
}
}
// onFocusChanged: {
// if (focusItem.activeFocus) {
// fl.contentY = 0
// }
// }
// }
BackButtonType {
id: backButton
@ -34,8 +32,6 @@ PageType {
anchors.left: parent.left
anchors.right: parent.right
anchors.topMargin: 20
KeyNavigation.tab: telegramButton
}
FlickableType {
@ -106,7 +102,6 @@ PageType {
descriptionText: qsTr("To discuss features")
leftImageSource: "qrc:/images/controls/telegram.svg"
KeyNavigation.tab: mailButton
parentFlickable: fl
clickedFunction: function() {
@ -124,7 +119,6 @@ PageType {
descriptionText: qsTr("For reviews and bug reports")
leftImageSource: "qrc:/images/controls/mail.svg"
KeyNavigation.tab: githubButton
parentFlickable: fl
clickedFunction: function() {
@ -143,7 +137,6 @@ PageType {
text: qsTr("GitHub")
leftImageSource: "qrc:/images/controls/github.svg"
KeyNavigation.tab: websiteButton
parentFlickable: fl
clickedFunction: function() {
@ -161,7 +154,6 @@ PageType {
text: qsTr("Website")
leftImageSource: "qrc:/images/controls/amnezia.svg"
KeyNavigation.tab: checkUpdatesButton
parentFlickable: fl
clickedFunction: function() {
@ -209,7 +201,6 @@ PageType {
text: qsTr("Check for updates")
KeyNavigation.tab: privacyPolicyButton
parentFlickable: fl
clickedFunc: function() {

View file

@ -15,8 +15,6 @@ import "../Components"
PageType {
id: root
defaultActiveFocusItem: focusItem
FlickableType {
id: fl
anchors.top: parent.top
@ -32,11 +30,6 @@ PageType {
spacing: 0
Item {
id: focusItem
// KeyNavigation.tab: backButton
}
LabelWithImageType {
Layout.fillWidth: true
Layout.margins: 16

View file

@ -21,8 +21,6 @@ import "../Components"
PageType {
id: root
defaultActiveFocusItem: focusItem
property bool pageEnabled
Component.onCompleted: {
@ -66,11 +64,6 @@ PageType {
}
}
Item {
id: focusItem
KeyNavigation.tab: backButton
}
ColumnLayout {
id: header
@ -82,7 +75,6 @@ PageType {
BackButtonType {
id: backButton
KeyNavigation.tab: switcher
}
RowLayout {
@ -103,10 +95,6 @@ PageType {
enabled: root.pageEnabled
KeyNavigation.tab: selector.enabled ?
selector :
searchField.textField
checked: AppSplitTunnelingModel.isTunnelingEnabled
onToggled: {
AppSplitTunnelingModel.toggleSplitTunneling(checked)
@ -130,8 +118,6 @@ PageType {
enabled: Qt.platform.os === "android" && root.pageEnabled
KeyNavigation.tab: searchField.textField
listView: ListViewWithRadioButtonType {
rootWidth: root.width

View file

@ -14,18 +14,15 @@ import "../Components"
PageType {
id: root
defaultActiveFocusItem: focusItem
// Item {
// id: focusItem
Item {
id: focusItem
KeyNavigation.tab: backButton
onFocusChanged: {
if (focusItem.activeFocus) {
fl.contentY = 0
}
}
}
// onFocusChanged: {
// if (focusItem.activeFocus) {
// fl.contentY = 0
// }
// }
// }
BackButtonType {
id: backButton
@ -35,7 +32,7 @@ PageType {
anchors.right: parent.right
anchors.topMargin: 20
KeyNavigation.tab: GC.isMobile() ? switcher : switcherAutoStart
// KeyNavigation.tab: GC.isMobile() ? switcher : switcherAutoStart
}
FlickableType {
@ -77,8 +74,8 @@ PageType {
}
}
KeyNavigation.tab: Qt.platform.os === "android" && !SettingsController.isNotificationPermissionGranted ?
labelWithButtonNotification.rightButton : labelWithButtonLanguage.rightButton
// KeyNavigation.tab: Qt.platform.os === "android" && !SettingsController.isNotificationPermissionGranted ?
// labelWithButtonNotification.rightButton : labelWithButtonLanguage.rightButton
parentFlickable: fl
}
@ -95,7 +92,7 @@ PageType {
descriptionText: qsTr("Enable notifications to show the VPN state in the status bar")
rightImageSource: "qrc:/images/controls/chevron-right.svg"
KeyNavigation.tab: labelWithButtonLanguage.rightButton
// KeyNavigation.tab: labelWithButtonLanguage.rightButton
parentFlickable: fl
clickedFunction: function() {
@ -117,7 +114,6 @@ PageType {
text: qsTr("Auto start")
descriptionText: qsTr("Launch the application every time the device is starts")
KeyNavigation.tab: switcherAutoConnect
parentFlickable: fl
checked: SettingsController.isAutoStartEnabled()
@ -142,7 +138,6 @@ PageType {
text: qsTr("Auto connect")
descriptionText: qsTr("Connect to VPN on app start")
KeyNavigation.tab: switcherStartMinimized
parentFlickable: fl
checked: SettingsController.isAutoConnectEnabled()
@ -167,7 +162,6 @@ PageType {
text: qsTr("Start minimized")
descriptionText: qsTr("Launch application minimized")
KeyNavigation.tab: labelWithButtonLanguage.rightButton
parentFlickable: fl
checked: SettingsController.isStartMinimizedEnabled()
@ -190,11 +184,10 @@ PageType {
descriptionText: LanguageModel.currentLanguageName
rightImageSource: "qrc:/images/controls/chevron-right.svg"
KeyNavigation.tab: labelWithButtonLogging.rightButton
parentFlickable: fl
clickedFunction: function() {
selectLanguageDrawer.open()
selectLanguageDrawer.openTriggered()
}
}
@ -208,7 +201,6 @@ PageType {
descriptionText: SettingsController.isLoggingEnabled ? qsTr("Enabled") : qsTr("Disabled")
rightImageSource: "qrc:/images/controls/chevron-right.svg"
KeyNavigation.tab: labelWithButtonReset.rightButton
parentFlickable: fl
clickedFunction: function() {
@ -245,12 +237,12 @@ PageType {
}
if (!GC.isMobile()) {
root.defaultActiveFocusItem.forceActiveFocus()
// root.defaultActiveFocusItem.forceActiveFocus()
}
}
var noButtonFunction = function() {
if (!GC.isMobile()) {
root.defaultActiveFocusItem.forceActiveFocus()
// root.defaultActiveFocusItem.forceActiveFocus()
}
}
@ -268,10 +260,10 @@ PageType {
width: root.width
height: root.height
onClosed: {
if (!GC.isMobile()) {
focusItem.forceActiveFocus()
}
}
// onClosed: {
// if (!GC.isMobile()) {
// focusItem.forceActiveFocus()
// }
// }
}
}

View file

@ -17,7 +17,7 @@ import "../Controls2/TextTypes"
PageType {
id: root
defaultActiveFocusItem: focusItem
// defaultActiveFocusItem: focusItem
Connections {
target: SettingsController
@ -36,11 +36,6 @@ PageType {
}
}
Item {
id: focusItem
KeyNavigation.tab: backButton
}
BackButtonType {
id: backButton
@ -48,8 +43,6 @@ PageType {
anchors.left: parent.left
anchors.right: parent.right
anchors.topMargin: 20
KeyNavigation.tab: makeBackupButton
}
FlickableType {
@ -111,8 +104,6 @@ PageType {
PageController.showNotificationMessage(qsTr("Backup file saved"))
}
}
KeyNavigation.tab: restoreBackupButton
}
BasicButtonType {

View file

@ -12,15 +12,8 @@ import "../Config"
PageType {
id: root
defaultActiveFocusItem: focusItem
property bool isAppSplitTinnelingEnabled: Qt.platform.os === "windows" || Qt.platform.os === "android"
Item {
id: focusItem
KeyNavigation.tab: backButton
}
BackButtonType {
id: backButton
@ -28,8 +21,6 @@ PageType {
anchors.left: parent.left
anchors.right: parent.right
anchors.topMargin: 20
KeyNavigation.tab: amneziaDnsSwitch
}
FlickableType {
@ -67,8 +58,6 @@ PageType {
SettingsController.toggleAmneziaDns(checked)
}
}
KeyNavigation.tab: dnsServersButton.rightButton
}
DividerType {}
@ -84,8 +73,6 @@ PageType {
clickedFunction: function() {
PageController.goToPage(PageEnum.PageSettingsDns)
}
KeyNavigation.tab: splitTunnelingButton.rightButton
}
DividerType {}

View file

@ -14,13 +14,6 @@ import "../Components"
PageType {
id: root
defaultActiveFocusItem: primaryDns.textField
Item {
id: focusItem
KeyNavigation.tab: backButton
}
BackButtonType {
id: backButton
@ -28,8 +21,6 @@ PageType {
anchors.left: parent.left
anchors.right: parent.right
anchors.topMargin: 20
KeyNavigation.tab: root.defaultActiveFocusItem
}
FlickableType {
@ -80,8 +71,6 @@ PageType {
textField.validator: RegularExpressionValidator {
regularExpression: InstallController.ipAddressRegExp()
}
KeyNavigation.tab: secondaryDns.textField
}
TextFieldWithHeaderType {
@ -94,8 +83,6 @@ PageType {
textField.validator: RegularExpressionValidator {
regularExpression: InstallController.ipAddressRegExp()
}
KeyNavigation.tab: restoreDefaultButton
}
BasicButtonType {
@ -124,19 +111,17 @@ PageType {
PageController.showNotificationMessage(qsTr("Settings have been reset"))
if (!GC.isMobile()) {
defaultActiveFocusItem.forceActiveFocus()
// defaultActiveFocusItem.forceActiveFocus()
}
}
var noButtonFunction = function() {
if (!GC.isMobile()) {
defaultActiveFocusItem.forceActiveFocus()
// defaultActiveFocusItem.forceActiveFocus()
}
}
showQuestionDrawer(headerText, "", yesButtonText, noButtonText, yesButtonFunction, noButtonFunction)
}
KeyNavigation.tab: saveButton
}
BasicButtonType {

View file

@ -16,13 +16,6 @@ import "../Controls2/TextTypes"
PageType {
id: root
defaultActiveFocusItem: focusItem
Item {
id: focusItem
KeyNavigation.tab: backButton
}
BackButtonType {
id: backButton
@ -30,8 +23,6 @@ PageType {
anchors.left: parent.left
anchors.right: parent.right
anchors.topMargin: 20
KeyNavigation.tab: switcher
}
FlickableType {
@ -68,12 +59,21 @@ PageType {
text: qsTr("Enable logs")
checked: SettingsController.isLoggingEnabled
//KeyNavigation.tab: openFolderButton
onCheckedChanged: {
if (checked !== SettingsController.isLoggingEnabled) {
SettingsController.isLoggingEnabled = checked
}
}
onFocusChanged: {
console.debug("MOVE THIS LOGIC TO CPP!")
if (activeFocus) {
if (fl) {
fl.ensureVisible(this)
}
}
}
}
DividerType {}
@ -87,8 +87,6 @@ PageType {
leftImageSource: "qrc:/images/controls/trash.svg"
isSmallLeftImage: true
// KeyNavigation.tab: labelWithButton3
clickedFunction: function() {
var headerText = qsTr("Clear logs?")
var yesButtonText = qsTr("Continue")
@ -104,9 +102,9 @@ PageType {
}
}
var noButtonFunction = function() {
if (!GC.isMobile()) {
focusItem.forceActiveFocus()
}
// if (!GC.isMobile()) {
// focusItem.forceActiveFocus()
// }
}
showQuestionDrawer(headerText, "", yesButtonText, noButtonText, yesButtonFunction, noButtonFunction)
@ -142,8 +140,6 @@ PageType {
leftImageSource: "qrc:/images/controls/folder-open.svg"
isSmallLeftImage: true
// KeyNavigation.tab: labelWithButton3
clickedFunction: function() {
SettingsController.openLogsFolder()
}
@ -161,7 +157,14 @@ PageType {
leftImageSource: "qrc:/images/controls/save.svg"
isSmallLeftImage: true
// KeyNavigation.tab: labelWithButton3
onFocusChanged: {
console.debug("MOVE THIS LOGIC TO CPP!")
if (activeFocus) {
if (fl) {
fl.ensureVisible(this)
}
}
}
clickedFunction: function() {
var fileName = ""
@ -221,7 +224,14 @@ PageType {
leftImageSource: "qrc:/images/controls/folder-open.svg"
isSmallLeftImage: true
// KeyNavigation.tab: labelWithButton3
onFocusChanged: {
console.debug("MOVE THIS LOGIC TO CPP!")
if (activeFocus) {
if (fl) {
fl.ensureVisible(this)
}
}
}
clickedFunction: function() {
SettingsController.openServiceLogsFolder()
@ -245,7 +255,14 @@ PageType {
leftImageSource: "qrc:/images/controls/save.svg"
isSmallLeftImage: true
// KeyNavigation.tab: labelWithButton3
onFocusChanged: {
console.debug("MOVE THIS LOGIC TO CPP!")
if (activeFocus) {
if (fl) {
fl.ensureVisible(this)
}
}
}
clickedFunction: function() {
var fileName = ""

View file

@ -100,8 +100,6 @@ PageType {
text: qsTr("Check the server for previously installed Amnezia services")
descriptionText: qsTr("Add them to the application if they were not displayed")
KeyNavigation.tab: labelWithButton2
clickedFunction: function() {
PageController.showBusyIndicator(true)
InstallController.scanServerForInstalledContainers()
@ -121,8 +119,6 @@ PageType {
text: qsTr("Reboot server")
textColor: AmneziaStyle.color.vibrantRed
KeyNavigation.tab: labelWithButton3
clickedFunction: function() {
var headerText = qsTr("Do you want to reboot the server?")
var descriptionText = qsTr("The reboot process may take approximately 30 seconds. Are you sure you wish to proceed?")

View file

@ -25,7 +25,7 @@ PageType {
property int pageSettingsApiServerInfo: 3
property int pageSettingsApiLanguageList: 4
defaultActiveFocusItem: focusItem
// defaultActiveFocusItem: focusItem
Connections {
target: PageController
@ -46,11 +46,6 @@ PageType {
]
}
Item {
id: focusItem
KeyNavigation.tab: header
}
ColumnLayout {
anchors.fill: parent
@ -75,7 +70,6 @@ PageType {
BackButtonType {
id: backButton
KeyNavigation.tab: headerContent.actionButton
backButtonFunction: function() {
if (nestedStackView.currentIndex === root.pageSettingsApiServerInfo &&
@ -108,13 +102,11 @@ PageType {
}
}
KeyNavigation.tab: tabBar
actionButtonFunction: function() {
if (nestedStackView.currentIndex === root.pageSettingsApiLanguageList) {
nestedStackView.currentIndex = root.pageSettingsApiServerInfo
} else {
serverNameEditDrawer.open()
serverNameEditDrawer.openTriggered()
}
}
}
@ -133,7 +125,7 @@ PageType {
}
}
expandedContent: ColumnLayout {
expandedStateContent: ColumnLayout {
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
@ -149,11 +141,6 @@ PageType {
}
}
Item {
id: focusItem1
KeyNavigation.tab: serverName.textField
}
TextFieldWithHeaderType {
id: serverName
@ -162,8 +149,6 @@ PageType {
textFieldText: name
textField.maximumLength: 30
checkEmptyText: true
KeyNavigation.tab: saveButton
}
BasicButtonType {
@ -172,7 +157,6 @@ PageType {
Layout.fillWidth: true
text: qsTr("Save")
KeyNavigation.tab: focusItem1
clickedFunc: function() {
if (serverName.textFieldText === "") {
@ -182,7 +166,7 @@ PageType {
if (serverName.textFieldText !== name) {
name = serverName.textFieldText
}
serverNameEditDrawer.close()
serverNameEditDrawer.closeTriggered()
}
}
}
@ -219,7 +203,6 @@ PageType {
isSelected: tabBar.currentIndex === root.pageSettingsServerProtocols
text: qsTr("Protocols")
KeyNavigation.tab: servicesTab
Keys.onReturnPressed: tabBar.currentIndex = root.pageSettingsServerProtocols
Keys.onEnterPressed: tabBar.currentIndex = root.pageSettingsServerProtocols
}
@ -231,7 +214,6 @@ PageType {
isSelected: tabBar.currentIndex === root.pageSettingsServerServices
text: qsTr("Services")
KeyNavigation.tab: dataTab
Keys.onReturnPressed: tabBar.currentIndex = root.pageSettingsServerServices
Keys.onEnterPressed: tabBar.currentIndex = root.pageSettingsServerServices
}

View file

@ -21,13 +21,6 @@ PageType {
property bool isClearCacheVisible: ServersModel.isProcessedServerHasWriteAccess() && !ContainersModel.isServiceContainer(ContainersModel.getProcessedContainerIndex())
defaultActiveFocusItem: focusItem
Item {
id: focusItem
KeyNavigation.tab: backButton
}
ColumnLayout {
id: header
@ -39,7 +32,6 @@ PageType {
BackButtonType {
id: backButton
KeyNavigation.tab: protocols
}
HeaderType {
@ -168,7 +160,6 @@ PageType {
Layout.fillWidth: true
visible: root.isClearCacheVisible
KeyNavigation.tab: removeButton
text: qsTr("Clear profile")

View file

@ -18,13 +18,6 @@ import "../Components"
PageType {
id: root
defaultActiveFocusItem: focusItem
Item {
id: focusItem
KeyNavigation.tab: backButton
}
ColumnLayout {
id: header
@ -36,7 +29,6 @@ PageType {
BackButtonType {
id: backButton
KeyNavigation.tab: servers
}
HeaderType {
@ -48,95 +40,88 @@ PageType {
}
}
FlickableType {
id: fl
ListView {
id: servers
objectName: "servers"
width: parent.width
anchors.top: header.bottom
anchors.topMargin: 16
contentHeight: col.implicitHeight
anchors.left: parent.left
anchors.right: parent.right
Column {
id: col
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
height: 500 // servers.contentItem.height // TODO: calculate height
ListView {
id: servers
width: parent.width
height: servers.contentItem.height
model: ServersModel
model: ServersModel
clip: true
interactive: false
clip: true
interactive: false
// activeFocusOnTab: true
// focus: true
// Keys.onTabPressed: {
// if (currentIndex < servers.count - 1) {
// servers.incrementCurrentIndex()
// } else {
// servers.currentIndex = 0
// focusItem.forceActiveFocus()
// root.lastItemTabClicked()
// }
activeFocusOnTab: true
focus: true
Keys.onTabPressed: {
if (currentIndex < servers.count - 1) {
servers.incrementCurrentIndex()
} else {
servers.currentIndex = 0
focusItem.forceActiveFocus()
root.lastItemTabClicked()
}
// fl.ensureVisible(this.currentItem)
// }
fl.ensureVisible(this.currentItem)
}
onVisibleChanged: {
if (visible) {
currentIndex = 0
}
}
onVisibleChanged: {
if (visible) {
currentIndex = 0
}
}
delegate: Item {
implicitWidth: servers.width
implicitHeight: delegateContent.implicitHeight
delegate: Item {
implicitWidth: servers.width
implicitHeight: delegateContent.implicitHeight
// onFocusChanged: {
// if (focus) {
// server.rightButton.forceActiveFocus()
// }
// }
onFocusChanged: {
if (focus) {
server.rightButton.forceActiveFocus()
}
}
ColumnLayout {
id: delegateContent
ColumnLayout {
id: delegateContent
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
LabelWithButtonType {
id: server
Layout.fillWidth: true
LabelWithButtonType {
id: server
Layout.fillWidth: true
text: name
parentFlickable: fl
descriptionText: {
var servicesNameString = ""
var servicesName = ServersModel.getAllInstalledServicesName(index)
for (var i = 0; i < servicesName.length; i++) {
servicesNameString += servicesName[i] + " · "
}
if (ServersModel.isServerFromApi(index)) {
return servicesNameString + serverDescription
} else {
return servicesNameString + hostName
}
}
rightImageSource: "qrc:/images/controls/chevron-right.svg"
clickedFunction: function() {
ServersModel.processedIndex = index
PageController.goToPage(PageEnum.PageSettingsServerInfo)
}
text: name
// parentFlickable: fl
descriptionText: {
var servicesNameString = ""
var servicesName = ServersModel.getAllInstalledServicesName(index)
for (var i = 0; i < servicesName.length; i++) {
servicesNameString += servicesName[i] + " · "
}
DividerType {}
if (ServersModel.isServerFromApi(index)) {
return servicesNameString + serverDescription
} else {
return servicesNameString + hostName
}
}
rightImageSource: "qrc:/images/controls/chevron-right.svg"
clickedFunction: function() {
ServersModel.processedIndex = index
PageController.goToPage(PageEnum.PageSettingsServerInfo)
}
}
DividerType {}
}
}
}

View file

@ -23,13 +23,6 @@ PageType {
property var isServerFromTelegramApi: ServersModel.getDefaultServerData("isServerFromTelegramApi")
defaultActiveFocusItem: searchField.textField
Item {
id: focusItem
KeyNavigation.tab: backButton
}
property bool pageEnabled
Component.onCompleted: {
@ -99,7 +92,6 @@ PageType {
BackButtonType {
id: backButton
KeyNavigation.tab: switcher
}
RowLayout {
@ -129,8 +121,6 @@ PageType {
onToggled: { onToggledFunc() }
Keys.onEnterPressed: { onToggledFunc() }
Keys.onReturnPressed: { onToggledFunc() }
KeyNavigation.tab: selector
}
}
@ -180,11 +170,11 @@ PageType {
}
}
KeyNavigation.tab: {
return sites.count > 0 ?
sites :
searchField.textField
}
// KeyNavigation.tab: {
// return sites.count > 0 ?
// sites :
// searchField.textField
// }
}
}
@ -325,7 +315,7 @@ PageType {
textFieldPlaceholderText: qsTr("website or IP")
buttonImageSource: "qrc:/images/controls/plus.svg"
KeyNavigation.tab: GC.isMobile() ? focusItem : addSiteButtonImage
// KeyNavigation.tab: GC.isMobile() ? focusItem : addSiteButtonImage
clickedFunc: function() {
PageController.showBusyIndicator(true)
@ -344,7 +334,7 @@ PageType {
imageColor: AmneziaStyle.color.paleGray
onClicked: function () {
moreActionsDrawer.open()
moreActionsDrawer.openTriggered()
}
Keys.onReturnPressed: addSiteButtonImage.clicked()
@ -361,12 +351,12 @@ PageType {
expandedHeight: parent.height * 0.4375
onClosed: {
if (root.defaultActiveFocusItem && !GC.isMobile()) {
root.defaultActiveFocusItem.forceActiveFocus()
}
// if (root.defaultActiveFocusItem && !GC.isMobile()) {
// root.defaultActiveFocusItem.forceActiveFocus()
// }
}
expandedContent: ColumnLayout {
expandedStateContent: ColumnLayout {
id: moreActionsDrawerContent
anchors.top: parent.top
@ -387,11 +377,6 @@ PageType {
}
}
Item {
id: focusItem1
KeyNavigation.tab: importSitesButton.rightButton
}
Header2Type {
Layout.fillWidth: true
Layout.margins: 16
@ -407,10 +392,8 @@ PageType {
rightImageSource: "qrc:/images/controls/chevron-right.svg"
clickedFunction: function() {
importSitesDrawer.open()
importSitesDrawer.openTriggered()
}
KeyNavigation.tab: exportSitesButton
}
DividerType {}
@ -420,8 +403,6 @@ PageType {
Layout.fillWidth: true
text: qsTr("Save site list")
KeyNavigation.tab: focusItem1
clickedFunction: function() {
var fileName = ""
if (GC.isMobile()) {
@ -436,7 +417,7 @@ PageType {
if (fileName !== "") {
PageController.showBusyIndicator(true)
SitesController.exportSites(fileName)
moreActionsDrawer.close()
moreActionsDrawer.closeTriggered()
PageController.showBusyIndicator(false)
}
}
@ -458,7 +439,7 @@ PageType {
}
}
expandedContent: Item {
expandedStateContent: Item {
implicitHeight: importSitesDrawer.expandedHeight
Connections {
@ -469,11 +450,6 @@ PageType {
}
}
Item {
id: focusItem2
KeyNavigation.tab: importSitesDrawerBackButton
}
BackButtonType {
id: importSitesDrawerBackButton
@ -482,10 +458,8 @@ PageType {
anchors.right: parent.right
anchors.topMargin: 16
KeyNavigation.tab: importSitesButton2
backButtonFunction: function() {
importSitesDrawer.close()
importSitesDrawer.closeTriggered()
}
}
@ -516,7 +490,6 @@ PageType {
Layout.fillWidth: true
text: qsTr("Replace site list")
KeyNavigation.tab: importSitesButton3
clickedFunction: function() {
var fileName = SystemController.getFileName(qsTr("Open sites file"),
@ -533,7 +506,6 @@ PageType {
id: importSitesButton3
Layout.fillWidth: true
text: qsTr("Add imported sites to existing ones")
KeyNavigation.tab: focusItem2
clickedFunction: function() {
var fileName = SystemController.getFileName(qsTr("Open sites file"),
@ -548,8 +520,8 @@ PageType {
PageController.showBusyIndicator(true)
SitesController.importSites(fileName, replaceExistingSites)
PageController.showBusyIndicator(false)
importSitesDrawer.close()
moreActionsDrawer.close()
importSitesDrawer.closeTriggered()
moreActionsDrawer.closeTriggered()
}
DividerType {}

View file

@ -15,8 +15,6 @@ import "../Components"
PageType {
id: root
defaultActiveFocusItem: focusItem
FlickableType {
id: fl
anchors.top: parent.top
@ -32,15 +30,9 @@ PageType {
spacing: 0
Item {
id: focusItem
KeyNavigation.tab: backButton
}
BackButtonType {
id: backButton
Layout.topMargin: 20
// KeyNavigation.tab: fileButton.rightButton
}
HeaderType {

View file

@ -14,8 +14,6 @@ import "../Config"
PageType {
id: root
defaultActiveFocusItem: focusItem
FlickableType {
id: fl
anchors.top: parent.top
@ -31,15 +29,9 @@ PageType {
spacing: 0
Item {
id: focusItem
KeyNavigation.tab: backButton
}
BackButtonType {
id: backButton
Layout.topMargin: 20
// KeyNavigation.tab: fileButton.rightButton
}
HeaderType {

View file

@ -25,7 +25,7 @@ PageType {
}
}
defaultActiveFocusItem: focusItem
// defaultActiveFocusItem: focusItem
FlickableType {
id: fl
@ -42,15 +42,11 @@ PageType {
spacing: 0
Item {
id: focusItem
KeyNavigation.tab: textKey.textField
}
HeaderType {
property bool isVisible: SettingsController.getInstallationUuid() !== "" || PageController.isStartPageVisible()
id: moreButton
property bool isVisible: SettingsController.getInstallationUuid() !== "" || PageController.isStartPageVisible()
Layout.fillWidth: true
Layout.topMargin: 24
Layout.rightMargin: 16
@ -60,7 +56,16 @@ PageType {
actionButtonImage: isVisible ? "qrc:/images/controls/more-vertical.svg" : ""
actionButtonFunction: function() {
moreActionsDrawer.open()
moreActionsDrawer.openTriggered()
}
actionButton.onFocusChanged: {
console.debug("MOVE THIS LOGIC TO CPP!")
if (actionButton.activeFocus) {
if (fl) {
fl.ensureVisible(moreButton)
}
}
}
DrawerType2 {
@ -71,7 +76,7 @@ PageType {
anchors.fill: parent
expandedHeight: root.height * 0.5
expandedContent: ColumnLayout {
expandedStateContent: ColumnLayout {
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
@ -154,8 +159,6 @@ PageType {
textField.text = ""
textField.paste()
}
KeyNavigation.tab: continueButton
}
BasicButtonType {
@ -166,10 +169,18 @@ PageType {
Layout.rightMargin: 16
Layout.leftMargin: 16
onFocusChanged: {
console.debug("MOVE THIS LOGIC TO CPP!")
if (activeFocus) {
if (fl) {
fl.ensureVisible(this)
}
}
}
visible: textKey.textFieldText !== ""
text: qsTr("Continue")
Keys.onTabPressed: lastItemTabClicked(focusItem)
clickedFunc: function() {
if (ImportController.extractConfigFromData(textKey.textFieldText)) {
@ -203,6 +214,15 @@ PageType {
rightImageSource: "qrc:/images/controls/chevron-right.svg"
leftImageSource: "qrc:/images/controls/amnezia.svg"
focusItem.onFocusChanged: {
console.debug("MOVE THIS LOGIC TO CPP!")
if (focusItem.activeFocus) {
if (fl) {
fl.ensureVisible(apiInstalling)
}
}
}
onClicked: function() {
PageController.showBusyIndicator(true)
var result = InstallController.fillAvailableServices()
@ -227,6 +247,15 @@ PageType {
rightImageSource: "qrc:/images/controls/chevron-right.svg"
leftImageSource: "qrc:/images/controls/server.svg"
focusItem.onFocusChanged: {
console.debug("MOVE THIS LOGIC TO CPP!")
if (focusItem.activeFocus) {
if (fl) {
fl.ensureVisible(manualInstalling)
}
}
}
onClicked: {
PageController.goToPage(PageEnum.PageSetupWizardCredentials)
}
@ -247,6 +276,15 @@ PageType {
rightImageSource: "qrc:/images/controls/chevron-right.svg"
leftImageSource: "qrc:/images/controls/archive-restore.svg"
focusItem.onFocusChanged: {
console.debug("MOVE THIS LOGIC TO CPP!")
if (focusItem.activeFocus) {
if (fl) {
fl.ensureVisible(backupRestore)
}
}
}
onClicked: {
var filePath = SystemController.getFileName(qsTr("Open backup file"),
qsTr("Backup files (*.backup)"))
@ -271,6 +309,13 @@ PageType {
rightImageSource: "qrc:/images/controls/chevron-right.svg"
leftImageSource: "qrc:/images/controls/folder-search-2.svg"
focusItem.onFocusChanged: {
console.debug("MOVE THIS LOGIC TO CPP!")
if (fl) {
fl.ensureVisible(openFile)
}
}
onClicked: {
var nameFilter = !ServersModel.getServersCount() ? "Config or backup files (*.vpn *.ovpn *.conf *.json *.backup)" :
"Config files (*.vpn *.ovpn *.conf *.json)"
@ -298,6 +343,15 @@ PageType {
rightImageSource: "qrc:/images/controls/chevron-right.svg"
leftImageSource: "qrc:/images/controls/scan-line.svg"
focusItem.onFocusChanged: {
console.debug("MOVE THIS LOGIC TO CPP!")
if (focusItem.activeFocus) {
if (fl) {
fl.ensureVisible(scanQr)
}
}
}
onClicked: {
ImportController.startDecodingQr()
if (Qt.platform.os === "ios") {
@ -321,6 +375,15 @@ PageType {
rightImageSource: "qrc:/images/controls/chevron-right.svg"
leftImageSource: "qrc:/images/controls/help-circle.svg"
focusItem.onFocusChanged: {
console.debug("MOVE THIS LOGIC TO CPP!")
if (focusItem.activeFocus) {
if (fl) {
fl.ensureVisible(siteLink)
}
}
}
onClicked: {
Qt.openUrlExternally(LanguageModel.getCurrentSiteUrl())
}

View file

@ -13,12 +13,7 @@ import "../Controls2/TextTypes"
PageType {
id: root
defaultActiveFocusItem: hostname.textField
Item {
id: focusItem
KeyNavigation.tab: backButton
}
// defaultActiveFocusItem: hostname.textField
BackButtonType {
id: backButton
@ -27,8 +22,6 @@ PageType {
anchors.left: parent.left
anchors.right: parent.right
anchors.topMargin: 20
KeyNavigation.tab: hostname.textField
}
FlickableType {
@ -64,8 +57,6 @@ PageType {
textField.onFocusChanged: {
textField.text = textField.text.replace(/^\s+|\s+$/g, '')
}
KeyNavigation.tab: username.textField
}
TextFieldWithHeaderType {
@ -78,8 +69,6 @@ PageType {
textField.onFocusChanged: {
textField.text = textField.text.replace(/^\s+|\s+$/g, '')
}
KeyNavigation.tab: secretData.textField
}
TextFieldWithHeaderType {
@ -100,8 +89,6 @@ PageType {
textField.onFocusChanged: {
textField.text = textField.text.replace(/^\s+|\s+$/g, '')
}
KeyNavigation.tab: continueButton
}
BasicButtonType {
@ -112,8 +99,6 @@ PageType {
text: qsTr("Continue")
Keys.onTabPressed: lastItemTabClicked(focusItem)
clickedFunc: function() {
forceActiveFocus()
if (!isCredentialsFilled()) {

View file

@ -17,7 +17,6 @@ PageType {
id: root
property bool isEasySetup: true
defaultActiveFocusItem: focusItem
SortFilterProxyModel {
id: proxyContainersModel
@ -34,14 +33,6 @@ PageType {
}
}
Item {
id: focusItem
implicitWidth: 1
implicitHeight: 54
KeyNavigation.tab: backButton
}
BackButtonType {
id: backButton
@ -49,8 +40,6 @@ PageType {
anchors.left: parent.left
anchors.right: parent.right
anchors.topMargin: 20
KeyNavigation.tab: continueButton
}
FlickableType {
@ -163,7 +152,7 @@ PageType {
implicitWidth: parent.width
text: qsTr("Continue")
KeyNavigation.tab: setupLaterButton
parentFlickable: fl
clickedFunc: function() {

View file

@ -62,19 +62,12 @@ PageType {
anchors.rightMargin: 16
anchors.leftMargin: 16
Item {
id: focusItem
KeyNavigation.tab: backButton
}
BackButtonType {
id: backButton
Layout.topMargin: 20
Layout.rightMargin: -16
Layout.leftMargin: -16
KeyNavigation.tab: showDetailsButton
}
HeaderType {
@ -113,13 +106,13 @@ PageType {
parent: root
onClosed: {
if (!GC.isMobile()) {
defaultActiveFocusItem.forceActiveFocus()
// defaultActiveFocusItem.forceActiveFocus()
}
}
anchors.fill: parent
expandedHeight: parent.height * 0.9
expandedContent: Item {
expandedStateContent: Item {
Connections {
target: showDetailsDrawer
enabled: !GC.isMobile()
@ -130,15 +123,15 @@ PageType {
implicitHeight: showDetailsDrawer.expandedHeight
Item {
id: focusItem2
KeyNavigation.tab: showDetailsBackButton
onFocusChanged: {
if (focusItem2.activeFocus) {
fl.contentY = 0
}
}
}
// Item {
// id: focusItem2
// KeyNavigation.tab: showDetailsBackButton
// onFocusChanged: {
// if (focusItem2.activeFocus) {
// fl.contentY = 0
// }
// }
// }
BackButtonType {
id: showDetailsBackButton
@ -148,8 +141,6 @@ PageType {
anchors.right: parent.right
anchors.topMargin: 16
KeyNavigation.tab: showDetailsCloseButton
backButtonFunction: function() {
showDetailsDrawer.close()
}
@ -230,7 +221,7 @@ PageType {
Layout.fillWidth: true
rootWidth: root.width
KeyNavigation.tab: (port.visible && port.enabled) ? port.textField : installButton
// KeyNavigation.tab: (port.visible && port.enabled) ? port.textField : installButton
}
TextFieldWithHeaderType {
@ -242,8 +233,6 @@ PageType {
headerText: qsTr("Port")
textField.maximumLength: 5
textField.validator: IntValidator { bottom: 1; top: 65535 }
KeyNavigation.tab: installButton
}
Rectangle {
@ -289,10 +278,10 @@ PageType {
transportProtoSelector.visible = protocolSelectorVisible
transportProtoHeader.visible = protocolSelectorVisible
if (port.visible && port.enabled)
defaultActiveFocusItem = port.textField
else
defaultActiveFocusItem = focusItem
// if (port.visible && port.enabled)
// defaultActiveFocusItem = port.textField
// else
// defaultActiveFocusItem = focusItem
}
}
}

View file

@ -15,13 +15,6 @@ import "../Config"
PageType {
id: root
defaultActiveFocusItem: focusItem
Item {
id: focusItem
KeyNavigation.tab: backButton
}
SortFilterProxyModel {
id: proxyContainersModel
sourceModel: ContainersModel
@ -52,7 +45,6 @@ PageType {
BackButtonType {
id: backButton
KeyNavigation.tab: containers
}
}

View file

@ -14,8 +14,6 @@ import "../Components"
PageType {
id: root
defaultActiveFocusItem: focusItem
ColumnLayout {
id: content
@ -32,11 +30,6 @@ PageType {
Layout.preferredHeight: 287
}
Item {
id: focusItem
KeyNavigation.tab: startButton
}
BasicButtonType {
id: startButton
Layout.fillWidth: true
@ -50,8 +43,6 @@ PageType {
clickedFunc: function() {
PageController.goToPage(PageEnum.PageSetupWizardConfigSource)
}
Keys.onTabPressed: lastItemTabClicked(focusItem)
}
}
}

View file

@ -13,14 +13,6 @@ import "../Config"
PageType {
id: root
defaultActiveFocusItem: textKey.textField
Item {
id: focusItem
KeyNavigation.tab: backButton
}
FlickableType {
id: fl
anchors.top: parent.top
@ -39,7 +31,6 @@ PageType {
BackButtonType {
id: backButton
Layout.topMargin: 20
KeyNavigation.tab: textKey.textField
}
HeaderType {
@ -67,8 +58,6 @@ PageType {
textField.text = ""
textField.paste()
}
KeyNavigation.tab: continueButton
}
}
}

View file

@ -16,13 +16,6 @@ PageType {
property bool showContent: false
defaultActiveFocusItem: focusItem
Item {
id: focusItem
KeyNavigation.tab: backButton
}
BackButtonType {
id: backButton
@ -30,8 +23,6 @@ PageType {
anchors.left: parent.left
anchors.right: parent.right
anchors.topMargin: 20
KeyNavigation.tab: showContentButton
}
Connections {
@ -107,7 +98,6 @@ PageType {
textColor: AmneziaStyle.color.goldenApricot
text: showContent ? qsTr("Collapse content") : qsTr("Show content")
KeyNavigation.tab: connectButton
clickedFunc: function() {
showContent = !showContent

View file

@ -18,8 +18,6 @@ import "../Config"
PageType {
id: root
defaultActiveFocusItem: clientNameTextField.textField
enum ConfigType {
AmneziaConnection,
OpenVpn,
@ -47,7 +45,7 @@ PageType {
shareConnectionDrawer.headerText = qsTr("Connection to ") + serverSelector.text
shareConnectionDrawer.configContentHeaderText = qsTr("File with connection settings to ") + serverSelector.text
shareConnectionDrawer.open()
shareConnectionDrawer.
shareConnectionDrawer.contentVisible = false
PageController.showBusyIndicator(true)
@ -104,7 +102,7 @@ PageType {
}
function onExportErrorOccurred(error) {
shareConnectionDrawer.close()
shareConnectionDrawer.closeTriggered()
PageController.showErrorMessage(error)
}
@ -172,16 +170,6 @@ PageType {
spacing: 0
Item {
id: focusItem
KeyNavigation.tab: header.actionButton
onFocusChanged: {
if (focusItem.activeFocus) {
a.contentY = 0
}
}
}
HeaderType {
id: header
Layout.fillWidth: true
@ -191,10 +179,18 @@ PageType {
actionButtonImage: "qrc:/images/controls/more-vertical.svg"
actionButtonFunction: function() {
shareFullAccessDrawer.open()
shareFullAccessDrawer.openTriggered()
}
KeyNavigation.tab: connectionRadioButton
// KeyNavigation.tab: connectionRadioButton
actionButton.onFocusChanged: {
console.debug("MOVE THIS LOGIC TO CPP!")
if (actionButton.activeFocus) {
if (fl) {
fl.ensureVisible(moreButton)
}
}
}
DrawerType2 {
id: shareFullAccessDrawer
@ -205,11 +201,11 @@ PageType {
expandedHeight: root.height
onClosed: {
if (!GC.isMobile()) {
clientNameTextField.textField.forceActiveFocus()
// clientNameTextField.textField.forceActiveFocus()
}
}
expandedContent: ColumnLayout {
expandedStateContent: ColumnLayout {
id: shareFullAccessDrawerContent
anchors.top: parent.top
anchors.left: parent.left
@ -226,7 +222,7 @@ PageType {
target: shareFullAccessDrawer
enabled: !GC.isMobile()
function onOpened() {
focusItem.forceActiveFocus()
// focusItem.forceActiveFocus()
}
}
@ -240,10 +236,10 @@ PageType {
descriptionText: qsTr("Use for your own devices, or share with those you trust to manage the server.")
}
Item {
id: focusItem
KeyNavigation.tab: shareFullAccessButton.rightButton
}
// Item {
// id: focusItem
// // KeyNavigation.tab: shareFullAccessButton.rightButton
// }
LabelWithButtonType {
id: shareFullAccessButton
@ -251,11 +247,11 @@ PageType {
text: qsTr("Share")
rightImageSource: "qrc:/images/controls/chevron-right.svg"
KeyNavigation.tab: focusItem
// KeyNavigation.tab: focusItem
clickedFunction: function() {
PageController.goToPage(PageEnum.PageShareFullAccess)
shareFullAccessDrawer.close()
shareFullAccessDrawer.closeTriggered()
}
}
@ -288,12 +284,12 @@ PageType {
implicitWidth: (root.width - 32) / 2
text: qsTr("Connection")
KeyNavigation.tab: usersRadioButton
// KeyNavigation.tab: usersRadioButton
onClicked: {
accessTypeSelector.currentIndex = 0
if (!GC.isMobile()) {
clientNameTextField.textField.forceActiveFocus()
// clientNameTextField.textField.forceActiveFocus()
}
}
}
@ -305,7 +301,7 @@ PageType {
implicitWidth: (root.width - 32) / 2
text: qsTr("Users")
KeyNavigation.tab: accessTypeSelector.currentIndex === 0 ? clientNameTextField.textField : serverSelector
// KeyNavigation.tab: accessTypeSelector.currentIndex === 0 ? clientNameTextField.textField : serverSelector
onClicked: {
accessTypeSelector.currentIndex = 1
@ -313,7 +309,7 @@ PageType {
ExportController.updateClientManagementModel(ContainersModel.getProcessedContainerIndex(),
ServersModel.getProcessedServerCredentials())
PageController.showBusyIndicator(false)
focusItem.forceActiveFocus()
// focusItem.forceActiveFocus()
}
}
}
@ -343,7 +339,7 @@ PageType {
checkEmptyText: true
KeyNavigation.tab: serverSelector
// KeyNavigation.tab: serverSelector
}
@ -390,7 +386,7 @@ PageType {
serverSelector.severSelectorIndexChanged()
}
serverSelector.close()
serverSelector.closeTriggered()
}
Component.onCompleted: {
@ -409,7 +405,7 @@ PageType {
}
}
KeyNavigation.tab: protocolSelector
// KeyNavigation.tab: protocolSelector
}
DropDownType {
@ -450,7 +446,7 @@ PageType {
clickedFunction: function() {
handler()
protocolSelector.close()
protocolSelector.closeTriggered()
}
Connections {
@ -509,11 +505,11 @@ PageType {
}
}
KeyNavigation.tab: accessTypeSelector.currentIndex === 0 ?
exportTypeSelector :
isSearchBarVisible ?
searchTextField.textField :
usersHeader.actionButton
// KeyNavigation.tab: accessTypeSelector.currentIndex === 0 ?
// exportTypeSelector : searchTextField.textField
// isSearchBarVisible ?
// searchTextField.textField :
// usersHeader.actionButton
}
DropDownType {
@ -549,7 +545,7 @@ PageType {
clickedFunction: function() {
exportTypeSelector.text = selectedText
exportTypeSelector.currentIndex = currentIndex
exportTypeSelector.close()
exportTypeSelector.closeTriggered()
}
Component.onCompleted: {
@ -558,7 +554,7 @@ PageType {
}
}
KeyNavigation.tab: shareButton
// KeyNavigation.tab: shareButton
}
@ -622,11 +618,11 @@ PageType {
target: root
function onIsSearchBarVisibleChanged() {
if (root.isSearchBarVisible) {
searchTextField.textField.forceActiveFocus()
// searchTextField.textField.forceActiveFocus()
} else {
searchTextField.textFieldText = ""
if (!GC.isMobile()) {
usersHeader.actionButton.forceActiveFocus()
// usersHeader.actionButton.forceActiveFocus()
}
}
}
@ -638,15 +634,15 @@ PageType {
function navigateTo() {
if (GC.isMobile()) {
focusItem.forceActiveFocus()
// focusItem.forceActiveFocus()
return;
}
if (searchTextField.textFieldText === "") {
root.isSearchBarVisible = false
usersHeader.actionButton.forceActiveFocus()
// usersHeader.actionButton.forceActiveFocus()
} else {
closeSearchButton.forceActiveFocus()
// closeSearchButton.forceActiveFocus()
}
}
@ -663,9 +659,9 @@ PageType {
Keys.onTabPressed: {
if (!GC.isMobile()) {
if (clientsListView.model.count > 0) {
clientsListView.forceActiveFocus()
// clientsListView.forceActiveFocus()
} else {
lastItemTabClicked(focusItem)
// lastItemTabClicked(focusItem)
}
}
}
@ -706,10 +702,10 @@ PageType {
if (!GC.isMobile()) {
if (currentIndex < this.count - 1) {
this.incrementCurrentIndex()
currentItem.focusItem.forceActiveFocus()
// currentItem.focusItem.forceActiveFocus()
} else {
this.currentIndex = 0
lastItemTabClicked(focusItem)
// lastItemTabClicked(focusItem)
}
}
}
@ -717,7 +713,7 @@ PageType {
onActiveFocusChanged: {
if (focus && !GC.isMobile()) {
currentIndex = 0
currentItem.focusItem.forceActiveFocus()
// currentItem.focusItem.forceActiveFocus()
}
}
@ -735,7 +731,7 @@ PageType {
implicitWidth: clientsListView.width
implicitHeight: delegateContent.implicitHeight
property alias focusItem: clientFocusItem.rightButton
// property alias focusItem: clientFocusItem.rightButton
ColumnLayout {
id: delegateContent
@ -755,7 +751,7 @@ PageType {
rightImageSource: "qrc:/images/controls/chevron-right.svg"
clickedFunction: function() {
clientInfoDrawer.open()
clientInfoDrawer.openTriggered()
}
}
@ -768,15 +764,15 @@ PageType {
onClosed: {
if (!GC.isMobile()) {
focusItem.forceActiveFocus()
// focusItem.forceActiveFocus()
}
}
width: root.width
height: root.height
expandedContent: ColumnLayout {
id: expandedContent
expandedStateContent: ColumnLayout {
id: expandedStateContent
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
@ -785,14 +781,14 @@ PageType {
anchors.rightMargin: 16
onImplicitHeightChanged: {
clientInfoDrawer.expandedHeight = expandedContent.implicitHeight + 32
clientInfoDrawer.expandedHeight = expandedStateContent.implicitHeight + 32
}
Connections {
target: clientInfoDrawer
enabled: !GC.isMobile()
function onOpened() {
focusItem1.forceActiveFocus()
// focusItem1.forceActiveFocus()
}
}
@ -846,11 +842,6 @@ PageType {
text: qsTr("Allowed IPs: %1").arg(allowedIps)
}
Item {
id: focusItem1
KeyNavigation.tab: renameButton
}
BasicButtonType {
id: renameButton
Layout.fillWidth: true
@ -865,10 +856,10 @@ PageType {
text: qsTr("Rename")
KeyNavigation.tab: revokeButton
// KeyNavigation.tab: revokeButton
clickedFunc: function() {
clientNameEditDrawer.open()
clientNameEditDrawer.openTriggered()
}
DrawerType2 {
@ -881,11 +872,11 @@ PageType {
onClosed: {
if (!GC.isMobile()) {
focusItem1.forceActiveFocus()
// focusItem1.forceActiveFocus()
}
}
expandedContent: ColumnLayout {
expandedStateContent: ColumnLayout {
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
@ -897,15 +888,10 @@ PageType {
target: clientNameEditDrawer
enabled: !GC.isMobile()
function onOpened() {
clientNameEditor.textField.forceActiveFocus()
// clientNameEditor.textField.forceActiveFocus()
}
}
Item {
id: focusItem2
KeyNavigation.tab: clientNameEditor.textField
}
TextFieldWithHeaderType {
id: clientNameEditor
Layout.fillWidth: true
@ -914,7 +900,7 @@ PageType {
textField.maximumLength: 20
checkEmptyText: true
KeyNavigation.tab: saveButton
// KeyNavigation.tab: saveButton
}
BasicButtonType {
@ -923,7 +909,7 @@ PageType {
Layout.fillWidth: true
text: qsTr("Save")
KeyNavigation.tab: focusItem2
// KeyNavigation.tab: focusItem2
clickedFunc: function() {
if (clientNameEditor.textFieldText === "") {
@ -937,7 +923,7 @@ PageType {
ContainersModel.getProcessedContainerIndex(),
ServersModel.getProcessedServerCredentials())
PageController.showBusyIndicator(false)
clientNameEditDrawer.close()
clientNameEditDrawer.closeTriggered()
}
}
}
@ -958,7 +944,7 @@ PageType {
borderWidth: 1
text: qsTr("Revoke")
KeyNavigation.tab: focusItem1
// KeyNavigation.tab: focusItem1
clickedFunc: function() {
var headerText = qsTr("Revoke the config for a user - %1?").arg(clientName)
@ -967,12 +953,12 @@ PageType {
var noButtonText = qsTr("Cancel")
var yesButtonFunction = function() {
clientInfoDrawer.close()
clientInfoDrawer.closeTriggered()
root.revokeConfig(index)
}
var noButtonFunction = function() {
if (!GC.isMobile()) {
focusItem1.forceActiveFocus()
// focusItem1.forceActiveFocus()
}
}
@ -993,7 +979,7 @@ PageType {
anchors.fill: parent
onClosed: {
if (!GC.isMobile()) {
clientNameTextField.textField.forceActiveFocus()
// clientNameTextField.textField.forceActiveFocus()
}
}
}
@ -1001,7 +987,7 @@ PageType {
MouseArea {
anchors.fill: parent
onPressed: function(mouse) {
forceActiveFocus()
// forceActiveFocus()
mouse.accepted = false
}
}

View file

@ -18,12 +18,7 @@ import "../Config"
PageType {
id: root
defaultActiveFocusItem: focusItem
Item {
id: focusItem
KeyNavigation.tab: backButton
}
// defaultActiveFocusItem: focusItem
BackButtonType {
id: backButton
@ -32,8 +27,6 @@ PageType {
anchors.left: parent.left
anchors.right: parent.right
anchors.topMargin: 20
KeyNavigation.tab: serverSelector
}
FlickableType {
@ -85,8 +78,6 @@ PageType {
descriptionText: qsTr("Server")
headerText: qsTr("Server")
KeyNavigation.tab: shareButton
listView: ListViewWithRadioButtonType {
id: serverSelectorListView
@ -137,8 +128,6 @@ PageType {
text: qsTr("Share")
leftImageSource: "qrc:/images/controls/share-2.svg"
Keys.onTabPressed: lastItemTabClicked(focusItem)
clickedFunc: function() {
PageController.showBusyIndicator(true)
@ -166,10 +155,5 @@ PageType {
id: shareConnectionDrawer
anchors.fill: parent
onClosed: {
if (!GC.isMobile()) {
focusItem.forceActiveFocus()
}
}
}
}

View file

@ -15,12 +15,12 @@ import "../Components"
PageType {
id: root
defaultActiveFocusItem: homeTabButton
property bool isControlsDisabled: false
property bool isTabBarDisabled: false
Connections {
objectName: "pageControllerConnection"
target: PageController
function onGoToPageHome() {
@ -91,18 +91,20 @@ PageType {
}
}
function onForceTabBarActiveFocus() {
homeTabButton.focus = true
tabBar.forceActiveFocus()
}
// function onForceTabBarActiveFocus() {
// homeTabButton.focus = true
// tabBar.forceActiveFocus()
// }
function onForceStackActiveFocus() {
homeTabButton.focus = true
tabBarStackView.forceActiveFocus()
}
// function onForceStackActiveFocus() {
// homeTabButton.focus = true
// tabBarStackView.forceActiveFocus()
// }
}
Connections {
objectName: "installControllerConnections"
target: InstallController
function onInstallationErrorOccurred(error) {
@ -165,6 +167,8 @@ PageType {
}
Connections {
objectName: "connectionControllerConnections"
target: ConnectionController
function onReconnectWithUpdatedContainer(message) {
@ -182,6 +186,8 @@ PageType {
}
Connections {
objectName: "importControllerConnections"
target: ImportController
function onImportErrorOccurred(error, goToPageHome) {
@ -196,6 +202,8 @@ PageType {
}
Connections {
objectName: "settingsControllerConnections"
target: SettingsController
function onLoggingDisableByWatcher() {
@ -218,6 +226,7 @@ PageType {
StackViewType {
id: tabBarStackView
objectName: "tabBarStackView"
anchors.top: parent.top
anchors.right: parent.right
@ -254,6 +263,7 @@ PageType {
TabBar {
id: tabBar
objectName: "tabBar"
anchors.right: parent.right
anchors.left: parent.left
@ -269,6 +279,8 @@ PageType {
enabled: !root.isControlsDisabled && !root.isTabBarDisabled
background: Shape {
objectName: "backgroundShape"
width: parent.width
height: parent.height
@ -289,21 +301,25 @@ PageType {
TabImageButtonType {
id: homeTabButton
objectName: "homeTabButton"
isSelected: tabBar.currentIndex === 0
image: "qrc:/images/controls/home.svg"
clickedFunc: function () {
tabBarStackView.goToTabBarPage(PageEnum.PageHome)
ServersModel.processedIndex = ServersModel.defaultIndex
tabBar.currentIndex = 0
FocusController.setRootItem(null) // TODO: move to do it automaticaly
}
KeyNavigation.tab: shareTabButton
Keys.onEnterPressed: this.clicked()
Keys.onReturnPressed: this.clicked()
// KeyNavigation.tab: shareTabButton
// Keys.onEnterPressed: this.clicked()
// Keys.onReturnPressed: this.clicked()
}
TabImageButtonType {
id: shareTabButton
objectName: "shareTabButton"
Connections {
target: ServersModel
@ -325,11 +341,13 @@ PageType {
tabBar.currentIndex = 1
}
KeyNavigation.tab: settingsTabButton
// KeyNavigation.tab: settingsTabButton
}
TabImageButtonType {
id: settingsTabButton
objectName: "settingsTabButton"
isSelected: tabBar.currentIndex === 2
image: "qrc:/images/controls/settings-2.svg"
clickedFunc: function () {
@ -337,11 +355,13 @@ PageType {
tabBar.currentIndex = 2
}
KeyNavigation.tab: plusTabButton
// KeyNavigation.tab: plusTabButton
}
TabImageButtonType {
id: plusTabButton
objectName: "plusTabButton"
isSelected: tabBar.currentIndex === 3
image: "qrc:/images/controls/plus.svg"
clickedFunc: function () {
@ -349,7 +369,7 @@ PageType {
tabBar.currentIndex = 3
}
Keys.onTabPressed: PageController.forceStackActiveFocus()
// Keys.onTabPressed: PageController.forceStackActiveFocus()
}
}
}