mirror of
https://github.com/outbackdingo/amnezia-client.git
synced 2026-01-27 10:18:14 +00:00
Removed defaultActiveFocusItem property, now FocusChainType takes it from focus chain, it is first element in chain.
Minor changes on FocusChainType.qml file.
This commit is contained in:
@@ -15,7 +15,8 @@ DrawerType2 {
|
||||
height: parent.height
|
||||
|
||||
expandedContent: FocusChainType {
|
||||
defaultActiveFocusItem: ip
|
||||
focus: root.visible
|
||||
focusTabBarOnLastItem: false
|
||||
|
||||
ColumnLayout {
|
||||
id: content
|
||||
|
||||
@@ -16,110 +16,109 @@ DrawerType2 {
|
||||
anchors.fill: parent
|
||||
expandedHeight: parent.height * 0.9
|
||||
|
||||
expandedContent: ColumnLayout {
|
||||
id: content
|
||||
expandedContent: FocusChainType {
|
||||
focus: root.visible
|
||||
focusTabBarOnLastItem: false
|
||||
|
||||
anchors.top: parent.top
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
spacing: 0
|
||||
ColumnLayout {
|
||||
id: content
|
||||
|
||||
// onActiveFocusChanged: {
|
||||
// console.log("onActiveFocusChanged ========================")
|
||||
// if (activeFocus) {
|
||||
// focusItem.forceActiveFocus()
|
||||
// }
|
||||
// }
|
||||
anchors.top: parent.top
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
spacing: 0
|
||||
|
||||
// Connections {
|
||||
// target: root
|
||||
// enabled: !GC.isMobile()
|
||||
// function onOpened() {
|
||||
// focusItem.forceActiveFocus()
|
||||
// }
|
||||
// }
|
||||
// onActiveFocusChanged: {
|
||||
// if (activeFocus) {
|
||||
// focusItem.forceActiveFocus()
|
||||
// }
|
||||
// }
|
||||
|
||||
Header2Type {
|
||||
Layout.fillWidth: true
|
||||
Layout.topMargin: 24
|
||||
Layout.rightMargin: 16
|
||||
Layout.leftMargin: 16
|
||||
Layout.bottomMargin: 16
|
||||
// Connections {
|
||||
// target: root
|
||||
// enabled: !GC.isMobile()
|
||||
// function onOpened() {
|
||||
// focusItem.forceActiveFocus()
|
||||
// }
|
||||
// }
|
||||
|
||||
headerText: qsTr("Split tunneling")
|
||||
descriptionText: qsTr("Allows you to connect to some sites or applications through a VPN connection and bypass others")
|
||||
}
|
||||
Header2Type {
|
||||
Layout.fillWidth: true
|
||||
Layout.topMargin: 24
|
||||
Layout.rightMargin: 16
|
||||
Layout.leftMargin: 16
|
||||
Layout.bottomMargin: 16
|
||||
|
||||
Item {
|
||||
id: focusItem
|
||||
KeyNavigation.tab: splitTunnelingSwitch.visible ? splitTunnelingSwitch : siteBasedSplitTunnelingSwitch.rightButton
|
||||
}
|
||||
|
||||
LabelWithButtonType {
|
||||
id: splitTunnelingSwitch
|
||||
Layout.fillWidth: true
|
||||
Layout.topMargin: 16
|
||||
|
||||
visible: ServersModel.isDefaultServerDefaultContainerHasSplitTunneling && ServersModel.getDefaultServerData("isServerFromApi")
|
||||
|
||||
text: qsTr("Split tunneling on the server")
|
||||
descriptionText: qsTr("Enabled \nCan't be disabled for current server")
|
||||
rightImageSource: "qrc:/images/controls/chevron-right.svg"
|
||||
|
||||
KeyNavigation.tab: siteBasedSplitTunnelingSwitch.visible ? siteBasedSplitTunnelingSwitch.rightButton : focusItem
|
||||
|
||||
clickedFunction: function() {
|
||||
// PageController.goToPage(PageEnum.PageSettingsSplitTunneling)
|
||||
// root.close()
|
||||
headerText: qsTr("Split tunneling")
|
||||
descriptionText: qsTr("Allows you to connect to some sites or applications through a VPN connection and bypass others")
|
||||
}
|
||||
}
|
||||
|
||||
DividerType {
|
||||
visible: ServersModel.isDefaultServerDefaultContainerHasSplitTunneling && ServersModel.getDefaultServerData("isServerFromApi")
|
||||
}
|
||||
LabelWithButtonType {
|
||||
id: splitTunnelingSwitch
|
||||
Layout.fillWidth: true
|
||||
Layout.topMargin: 16
|
||||
|
||||
LabelWithButtonType {
|
||||
id: siteBasedSplitTunnelingSwitch
|
||||
Layout.fillWidth: true
|
||||
Layout.topMargin: 16
|
||||
visible: ServersModel.isDefaultServerDefaultContainerHasSplitTunneling && ServersModel.getDefaultServerData("isServerFromApi")
|
||||
|
||||
text: qsTr("Site-based split tunneling")
|
||||
descriptionText: enabled && SitesModel.isTunnelingEnabled ? qsTr("Enabled") : qsTr("Disabled")
|
||||
rightImageSource: "qrc:/images/controls/chevron-right.svg"
|
||||
text: qsTr("Split tunneling on the server")
|
||||
descriptionText: qsTr("Enabled \nCan't be disabled for current server")
|
||||
rightImageSource: "qrc:/images/controls/chevron-right.svg"
|
||||
|
||||
KeyNavigation.tab: appSplitTunnelingSwitch.visible ?
|
||||
appSplitTunnelingSwitch.rightButton :
|
||||
focusItem
|
||||
// KeyNavigation.tab: siteBasedSplitTunnelingSwitch.visible ? siteBasedSplitTunnelingSwitch.rightButton : focusItem
|
||||
|
||||
clickedFunction: function() {
|
||||
PageController.goToPage(PageEnum.PageSettingsSplitTunneling)
|
||||
root.close()
|
||||
clickedFunction: function() {
|
||||
// PageController.goToPage(PageEnum.PageSettingsSplitTunneling)
|
||||
// root.close()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
DividerType {
|
||||
}
|
||||
|
||||
LabelWithButtonType {
|
||||
id: appSplitTunnelingSwitch
|
||||
visible: isAppSplitTinnelingEnabled
|
||||
|
||||
Layout.fillWidth: true
|
||||
|
||||
text: qsTr("App-based split tunneling")
|
||||
descriptionText: AppSplitTunnelingModel.isTunnelingEnabled ? qsTr("Enabled") : qsTr("Disabled")
|
||||
rightImageSource: "qrc:/images/controls/chevron-right.svg"
|
||||
|
||||
KeyNavigation.tab: focusItem
|
||||
|
||||
clickedFunction: function() {
|
||||
PageController.goToPage(PageEnum.PageSettingsAppSplitTunneling)
|
||||
root.close()
|
||||
DividerType {
|
||||
visible: ServersModel.isDefaultServerDefaultContainerHasSplitTunneling && ServersModel.getDefaultServerData("isServerFromApi")
|
||||
}
|
||||
}
|
||||
|
||||
DividerType {
|
||||
visible: isAppSplitTinnelingEnabled
|
||||
LabelWithButtonType {
|
||||
id: siteBasedSplitTunnelingSwitch
|
||||
Layout.fillWidth: true
|
||||
Layout.topMargin: 16
|
||||
|
||||
text: qsTr("Site-based split tunneling")
|
||||
descriptionText: enabled && SitesModel.isTunnelingEnabled ? qsTr("Enabled") : qsTr("Disabled")
|
||||
rightImageSource: "qrc:/images/controls/chevron-right.svg"
|
||||
|
||||
// KeyNavigation.tab: appSplitTunnelingSwitch.visible ?
|
||||
// appSplitTunnelingSwitch.rightButton :
|
||||
// focusItem
|
||||
|
||||
clickedFunction: function() {
|
||||
PageController.goToPage(PageEnum.PageSettingsSplitTunneling)
|
||||
root.close()
|
||||
}
|
||||
}
|
||||
|
||||
DividerType {
|
||||
}
|
||||
|
||||
LabelWithButtonType {
|
||||
id: appSplitTunnelingSwitch
|
||||
visible: isAppSplitTinnelingEnabled
|
||||
|
||||
Layout.fillWidth: true
|
||||
|
||||
text: qsTr("App-based split tunneling")
|
||||
descriptionText: AppSplitTunnelingModel.isTunnelingEnabled ? qsTr("Enabled") : qsTr("Disabled")
|
||||
rightImageSource: "qrc:/images/controls/chevron-right.svg"
|
||||
|
||||
// KeyNavigation.tab: focusItem
|
||||
|
||||
clickedFunction: function() {
|
||||
PageController.goToPage(PageEnum.PageSettingsAppSplitTunneling)
|
||||
root.close()
|
||||
}
|
||||
}
|
||||
|
||||
DividerType {
|
||||
visible: isAppSplitTinnelingEnabled
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,8 +10,6 @@ import "TextTypes"
|
||||
FocusScope {
|
||||
id: root
|
||||
|
||||
/*required*/ property var parentPage
|
||||
|
||||
readonly property string drawerExpanded: "expanded"
|
||||
readonly property string drawerCollapsed: "collapsed"
|
||||
|
||||
@@ -44,30 +42,30 @@ FocusScope {
|
||||
signal opened
|
||||
|
||||
onClosed: {
|
||||
console.log("Drawer closed============================")
|
||||
if (GC.isMobile()) {
|
||||
return
|
||||
}
|
||||
|
||||
if (parentPage) {
|
||||
parentPage.forceActiveFocus()
|
||||
}
|
||||
// if (parent && parent instanceof PageType) {
|
||||
// parent.focusItem_.forceActiveFocus()
|
||||
// }
|
||||
|
||||
// tabBarStackView.currentItem.focusItem_.forceActiveFocus()
|
||||
|
||||
// PageController.forceStackActiveFocus()
|
||||
}
|
||||
|
||||
onOpened: {
|
||||
console.log("Drawer opened============================")
|
||||
if (GC.isMobile()) {
|
||||
return
|
||||
}
|
||||
// onOpened: {
|
||||
// if (GC.isMobile()) {
|
||||
// return
|
||||
// }
|
||||
|
||||
if (root.expandedContent) {
|
||||
expandedLoader.item.forceActiveFocus()
|
||||
}
|
||||
}
|
||||
// if (root.expandedContent) {
|
||||
// expandedLoader.item.forceActiveFocus()
|
||||
// }
|
||||
// }
|
||||
|
||||
onActiveFocusChanged: {
|
||||
console.log("Drawer active focus changed============================")
|
||||
if (GC.isMobile()) {
|
||||
return
|
||||
}
|
||||
@@ -77,15 +75,15 @@ FocusScope {
|
||||
}
|
||||
}
|
||||
|
||||
// onOpened: {
|
||||
// if (isOpened) {
|
||||
// if (drawerContent.state === root.drawerExpanded) {
|
||||
// expandedLoader.item.forceActiveFocus()
|
||||
// } else {
|
||||
// collapsedLoader.item.forceActiveFocus()
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
onOpened: {
|
||||
if (isOpened) {
|
||||
if (drawerContent.state === root.drawerExpanded) {
|
||||
expandedLoader.item.forceActiveFocus()
|
||||
} else {
|
||||
collapsedLoader.item.forceActiveFocus()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: PageController
|
||||
|
||||
@@ -6,18 +6,23 @@ import "../Components"
|
||||
FocusScope {
|
||||
id: root
|
||||
|
||||
required property var defaultActiveFocusItem
|
||||
property bool focusTabBarOnLastItem: true
|
||||
property alias focusItem_: focusItem
|
||||
|
||||
property var focusChain: []
|
||||
QtObject {
|
||||
id: internal
|
||||
|
||||
onActiveFocusChanged: {
|
||||
// console.log("root activeFocusChanged=-=--=-=-=-=--", activeFocus)
|
||||
property var firstActiveFocusItem: null
|
||||
property var focusChain: []
|
||||
}
|
||||
|
||||
onVisibleChanged: {
|
||||
focusItem_.focus = true
|
||||
}
|
||||
|
||||
function getChildren(parent) {
|
||||
for (var i = 0; i < parent.children.length; i++) {
|
||||
var child = parent.children[i]
|
||||
// console.log(child)
|
||||
|
||||
if (child.children) {
|
||||
getChildren(child)
|
||||
@@ -26,33 +31,33 @@ FocusScope {
|
||||
}
|
||||
|
||||
function isFocusableItem(item) {
|
||||
// if (!item) { return false }
|
||||
if (!item || !item.visible || !item.enabled) {
|
||||
return false
|
||||
}
|
||||
|
||||
return item instanceof BasicButtonType ||
|
||||
item instanceof ConnectButton ||
|
||||
item instanceof LabelWithButtonType ||
|
||||
item instanceof SwitcherType ||
|
||||
item instanceof ImageButtonType ||
|
||||
item instanceof TextFieldWithHeaderType ||
|
||||
item instanceof BackButtonType ||
|
||||
item instanceof HorizontalRadioButton ||
|
||||
item instanceof DrawerType2 && !item.isOpened && item.collapsedContent
|
||||
}
|
||||
|
||||
function getFocusChain(parent) {
|
||||
let focusChain = []
|
||||
// console.log("-------------->", parent.children.length)
|
||||
// console.log(parent.children)
|
||||
// console.log("-------------->")
|
||||
for (var i = 0; i < parent.children.length; i++) {
|
||||
var child = parent.children[i]
|
||||
|
||||
if (
|
||||
child instanceof DropDownType ||
|
||||
if (child instanceof DropDownType ||
|
||||
child instanceof HomeSplitTunnelingDrawer ||
|
||||
child instanceof ConnectionTypeSelectionDrawer
|
||||
) {
|
||||
continue
|
||||
}
|
||||
// console.log(child, isFocusableItem(child), child.objectName)
|
||||
|
||||
if (isFocusableItem(child)) {
|
||||
focusChain.push(child)
|
||||
|
||||
@@ -67,65 +72,60 @@ FocusScope {
|
||||
return focusChain
|
||||
}
|
||||
|
||||
|
||||
|
||||
Component.onCompleted: {
|
||||
root.focusChain = getFocusChain(root)
|
||||
console.log("focusChain------------------>", focusChain)
|
||||
for (let i = 0; i < focusChain.length; i++) {
|
||||
focusChain[i].KeyNavigation.tab = focusChain[(i + 1) % focusChain.length]
|
||||
focusChain[i].KeyNavigation.backtab = focusChain[(i + focusChain.length - 1) % focusChain.length]
|
||||
internal.focusChain = getFocusChain(root)
|
||||
|
||||
if (internal.focusChain.length === 0) {
|
||||
return
|
||||
}
|
||||
|
||||
const lastItem = focusChain[focusChain.length - 1]
|
||||
for (let i = 0; i < internal.focusChain.length; i++) {
|
||||
internal.focusChain[i].KeyNavigation.tab = internal.focusChain[(i + 1) % internal.focusChain.length]
|
||||
internal.focusChain[i].KeyNavigation.backtab = internal.focusChain[(i + internal.focusChain.length - 1) % internal.focusChain.length]
|
||||
}
|
||||
|
||||
internal.firstActiveFocusItem = internal.focusChain[0]
|
||||
|
||||
const lastItem = internal.focusChain[internal.focusChain.length - 1]
|
||||
lastItem.Keys.onTabPressed.connect(function() {
|
||||
lastItemTabClicked(lastItem)
|
||||
})
|
||||
|
||||
for (let j = 0; j < internal.focusChain.length; j++) {
|
||||
if (internal.focusChain[j] instanceof TextFieldWithHeaderType) {
|
||||
internal.focusChain[j].forceActiveFocus()
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Item {
|
||||
id: focusItem
|
||||
focus: true
|
||||
// KeyNavigation.tab: defaultActiveFocusItem ? defaultActiveFocusItem : focusItem
|
||||
|
||||
Keys.onTabPressed: {
|
||||
// console.log("tab pressed", defaultActiveFocusItem)
|
||||
defaultActiveFocusItem.forceActiveFocus()
|
||||
}
|
||||
|
||||
onActiveFocusChanged: {
|
||||
// console.log("focusItem activeFocusChanged")
|
||||
|
||||
if (internal.firstActiveFocusItem) {
|
||||
internal.firstActiveFocusItem.focus = true
|
||||
internal.firstActiveFocusItem.forceActiveFocus()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function lastItemTabClicked(lastItem = null) {
|
||||
console.log("lastItemTabClicked", lastItem)
|
||||
function lastItemTabClicked() {
|
||||
focusItem.focus = true
|
||||
|
||||
if (GC.isMobile()) {
|
||||
return
|
||||
}
|
||||
|
||||
focusItem.forceActiveFocus()
|
||||
PageController.forceTabBarActiveFocus()
|
||||
|
||||
if (lastItem && lastItem.parentFlickable) {
|
||||
console.log("lastItemTabClicked", lastItem.parentFlickable)
|
||||
lastItem.parentFlickable.contentY = 0
|
||||
if (focusTabBarOnLastItem) {
|
||||
PageController.forceTabBarActiveFocus()
|
||||
}
|
||||
|
||||
// if (focusItem) {
|
||||
// focusItem.forceActiveFocus()
|
||||
// PageController.forceTabBarActiveFocus()
|
||||
// } else {
|
||||
// if (defaultActiveFocusItem) {
|
||||
// defaultActiveFocusItem.forceActiveFocus()
|
||||
// }
|
||||
// PageController.forceTabBarActiveFocus()
|
||||
// }
|
||||
|
||||
if (lastItem && lastItem.parentFlickable) {
|
||||
lastItem.parentFlickable.contentY = 0
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ import Style 1.0
|
||||
|
||||
import "TextTypes"
|
||||
|
||||
Item {
|
||||
FocusScope {
|
||||
id: root
|
||||
|
||||
property string headerText
|
||||
@@ -40,16 +40,17 @@ Item {
|
||||
implicitHeight: content.implicitHeight
|
||||
|
||||
property FlickableType parentFlickable
|
||||
Connections {
|
||||
target: textField
|
||||
function onFocusChanged() {
|
||||
if (textField.activeFocus) {
|
||||
if (root.parentFlickable) {
|
||||
root.parentFlickable.ensureVisible(root)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Connections {
|
||||
// target: textField
|
||||
// function onFocusChanged() {
|
||||
// if (textField.activeFocus) {
|
||||
// if (root.parentFlickable) {
|
||||
// root.parentFlickable.ensureVisible(root)
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
ColumnLayout {
|
||||
id: content
|
||||
@@ -85,6 +86,7 @@ Item {
|
||||
TextField {
|
||||
id: textField
|
||||
activeFocusOnTab: false
|
||||
focus: true
|
||||
|
||||
enabled: root.textFieldEditable
|
||||
color: root.enabled ? root.textFieldTextColor : root.textFieldTextDisabledColor
|
||||
@@ -119,6 +121,7 @@ Item {
|
||||
}
|
||||
|
||||
onActiveFocusChanged: {
|
||||
backgroud.border.color = getBackgroundBorderColor(root.borderColor)
|
||||
if (checkEmptyText && textFieldText === "") {
|
||||
errorText = qsTr("The field can't be empty")
|
||||
}
|
||||
@@ -136,9 +139,6 @@ Item {
|
||||
textObj: textField
|
||||
}
|
||||
|
||||
onFocusChanged: {
|
||||
backgroud.border.color = getBackgroundBorderColor(root.borderColor)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -199,7 +199,7 @@ Item {
|
||||
}
|
||||
|
||||
function getBackgroundBorderColor(noneFocusedColor) {
|
||||
return textField.focus ? root.borderFocusedColor : noneFocusedColor
|
||||
return textField.activeFocus ? root.borderFocusedColor : noneFocusedColor
|
||||
}
|
||||
|
||||
Keys.onEnterPressed: {
|
||||
|
||||
@@ -20,10 +20,6 @@ PageType {
|
||||
id: root
|
||||
focus: true
|
||||
|
||||
defaultActiveFocusItem: loggingButton.visible ?
|
||||
loggingButton :
|
||||
connectButton
|
||||
|
||||
Connections {
|
||||
target: PageController
|
||||
|
||||
@@ -140,412 +136,411 @@ PageType {
|
||||
objectName: "drawer"
|
||||
anchors.fill: parent
|
||||
focus: true
|
||||
parentPage: root
|
||||
|
||||
collapsedContent: FocusScope {
|
||||
id: collapsed123
|
||||
focus: true
|
||||
implicitHeight: Qt.platform.os !== "ios" ? root.height * 0.9 : screen.height * 0.77
|
||||
Component.onCompleted: {
|
||||
drawer.expandedHeight = implicitHeight
|
||||
}
|
||||
|
||||
// Connections {
|
||||
// target: drawer
|
||||
// enabled: !GC.isMobile()
|
||||
// function onActiveFocusChanged() {
|
||||
// if (drawer.activeFocus && !drawer.isOpened) {
|
||||
// collapsed123.forceActiveFocus()
|
||||
// // collapsedButtonChevron.forceActiveFocus()
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
ColumnLayout {
|
||||
id: collapsed
|
||||
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
|
||||
Component.onCompleted: {
|
||||
drawer.collapsedHeight = collapsed.implicitHeight
|
||||
}
|
||||
|
||||
DividerType {
|
||||
Layout.topMargin: 10
|
||||
Layout.fillWidth: false
|
||||
Layout.preferredWidth: 20
|
||||
Layout.preferredHeight: 2
|
||||
Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
Layout.topMargin: 14
|
||||
Layout.leftMargin: 24
|
||||
Layout.rightMargin: 24
|
||||
Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
|
||||
|
||||
spacing: 0
|
||||
|
||||
Connections {
|
||||
target: drawer
|
||||
function onEntered() {
|
||||
if (drawer.isCollapsed) {
|
||||
collapsedButtonChevron.backgroundColor = collapsedButtonChevron.hoveredColor
|
||||
collapsedButtonHeader.opacity = 0.8
|
||||
} else {
|
||||
collapsedButtonHeader.opacity = 1
|
||||
}
|
||||
}
|
||||
|
||||
function onExited() {
|
||||
if (drawer.isCollapsed) {
|
||||
collapsedButtonChevron.backgroundColor = collapsedButtonChevron.defaultColor
|
||||
collapsedButtonHeader.opacity = 1
|
||||
} else {
|
||||
collapsedButtonHeader.opacity = 1
|
||||
}
|
||||
}
|
||||
|
||||
function onPressed(pressed, entered) {
|
||||
if (drawer.isCollapsed) {
|
||||
collapsedButtonChevron.backgroundColor = pressed ? collapsedButtonChevron.pressedColor : entered ? collapsedButtonChevron.hoveredColor : collapsedButtonChevron.defaultColor
|
||||
collapsedButtonHeader.opacity = 0.7
|
||||
} else {
|
||||
collapsedButtonHeader.opacity = 1
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Header1TextType {
|
||||
id: collapsedButtonHeader
|
||||
Layout.maximumWidth: drawer.width - 48 - 18 - 12
|
||||
|
||||
maximumLineCount: 2
|
||||
elide: Qt.ElideRight
|
||||
|
||||
text: ServersModel.defaultServerName
|
||||
horizontalAlignment: Qt.AlignHCenter
|
||||
|
||||
Behavior on opacity {
|
||||
PropertyAnimation { duration: 200 }
|
||||
}
|
||||
}
|
||||
|
||||
ImageButtonType {
|
||||
id: collapsedButtonChevron
|
||||
|
||||
Layout.leftMargin: 8
|
||||
|
||||
visible: drawer.isCollapsed
|
||||
|
||||
hoverEnabled: false
|
||||
image: "qrc:/images/controls/chevron-down.svg"
|
||||
imageColor: AmneziaStyle.color.white
|
||||
|
||||
icon.width: 18
|
||||
icon.height: 18
|
||||
backgroundRadius: 16
|
||||
horizontalPadding: 4
|
||||
topPadding: 4
|
||||
bottomPadding: 3
|
||||
|
||||
Keys.onEnterPressed: collapsedButtonChevron.clicked()
|
||||
Keys.onReturnPressed: collapsedButtonChevron.clicked()
|
||||
// Keys.onTabPressed: lastItemTabClicked()
|
||||
|
||||
focus: true
|
||||
|
||||
onClicked: {
|
||||
if (drawer.isCollapsed) {
|
||||
drawer.open()
|
||||
focusItem1.forceActiveFocus()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
LabelTextType {
|
||||
id: collapsedServerMenuDescription
|
||||
Layout.bottomMargin: drawer.isCollapsed ? 44 : ServersModel.isDefaultServerFromApi ? 89 : 44
|
||||
Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
|
||||
text: drawer.isCollapsed ? ServersModel.defaultServerDescriptionCollapsed : ServersModel.defaultServerDescriptionExpanded
|
||||
}
|
||||
}
|
||||
|
||||
// Connections {
|
||||
// target: drawer
|
||||
// enabled: !GC.isMobile()
|
||||
// function onIsCollapsedChanged() {
|
||||
// if (!drawer.isCollapsed) {
|
||||
// focusItem1.forceActiveFocus()
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
ColumnLayout {
|
||||
id: serversMenuHeader
|
||||
|
||||
anchors.top: collapsed.bottom
|
||||
anchors.right: parent.right
|
||||
anchors.left: parent.left
|
||||
|
||||
RowLayout {
|
||||
Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
|
||||
focus: false
|
||||
spacing: 8
|
||||
|
||||
visible: !ServersModel.isDefaultServerFromApi
|
||||
|
||||
Item {
|
||||
id: focusItem1
|
||||
KeyNavigation.tab: serversMenuContent /*containersDropDown*/
|
||||
}
|
||||
|
||||
// DropDownType {
|
||||
// id: containersDropDown
|
||||
|
||||
// rootButtonImageColor: AmneziaStyle.color.black
|
||||
// rootButtonBackgroundColor: AmneziaStyle.color.white
|
||||
// rootButtonBackgroundHoveredColor: Qt.rgba(215, 216, 219, 0.8)
|
||||
// rootButtonBackgroundPressedColor: Qt.rgba(215, 216, 219, 0.65)
|
||||
// rootButtonHoveredBorderColor: AmneziaStyle.color.transparent
|
||||
// rootButtonDefaultBorderColor: AmneziaStyle.color.transparent
|
||||
// rootButtonTextTopMargin: 8
|
||||
// rootButtonTextBottomMargin: 8
|
||||
|
||||
// text: ServersModel.defaultServerDefaultContainerName
|
||||
// textColor: AmneziaStyle.color.black
|
||||
// headerText: qsTr("VPN protocol")
|
||||
// headerBackButtonImage: "qrc:/images/controls/arrow-left.svg"
|
||||
|
||||
// rootButtonClickedFunction: function() {
|
||||
// containersDropDown.open()
|
||||
// }
|
||||
|
||||
// drawerParent: root
|
||||
// KeyNavigation.tab: serversMenuContent
|
||||
|
||||
// listView: HomeContainersListView {
|
||||
// id: containersListView
|
||||
// rootWidth: root.width
|
||||
// // onVisibleChanged: {
|
||||
// // if (containersDropDown.visible && !GC.isMobile()) {
|
||||
// // focusItem1.forceActiveFocus()
|
||||
// // }
|
||||
// // }
|
||||
|
||||
// Connections {
|
||||
// target: ServersModel
|
||||
|
||||
// function onDefaultServerIndexChanged() {
|
||||
// updateContainersModelFilters()
|
||||
// }
|
||||
// }
|
||||
|
||||
// function updateContainersModelFilters() {
|
||||
// if (ServersModel.isDefaultServerHasWriteAccess()) {
|
||||
// proxyDefaultServerContainersModel.filters = ContainersModelFilters.getWriteAccessProtocolsListFilters()
|
||||
// } else {
|
||||
// proxyDefaultServerContainersModel.filters = ContainersModelFilters.getReadAccessProtocolsListFilters()
|
||||
// }
|
||||
// }
|
||||
|
||||
// model: SortFilterProxyModel {
|
||||
// id: proxyDefaultServerContainersModel
|
||||
// sourceModel: DefaultServerContainersModel
|
||||
|
||||
// sorters: [
|
||||
// RoleSorter { roleName: "isInstalled"; sortOrder: Qt.DescendingOrder }
|
||||
// ]
|
||||
// }
|
||||
|
||||
// Component.onCompleted: updateContainersModelFilters()
|
||||
// }
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
Header2Type {
|
||||
Layout.fillWidth: true
|
||||
Layout.topMargin: 48
|
||||
Layout.leftMargin: 16
|
||||
Layout.rightMargin: 16
|
||||
|
||||
headerText: qsTr("Servers")
|
||||
}
|
||||
}
|
||||
|
||||
ButtonGroup {
|
||||
id: serversRadioButtonGroup
|
||||
}
|
||||
|
||||
ListView {
|
||||
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()
|
||||
|
||||
KeyNavigation.tab: serverInfoButton
|
||||
}
|
||||
|
||||
ImageButtonType {
|
||||
id: serverInfoButton
|
||||
image: "qrc:/images/controls/settings.svg"
|
||||
imageColor: AmneziaStyle.color.white
|
||||
|
||||
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
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// collapsedContent: FocusScope {
|
||||
// id: collapsed123
|
||||
// focus: true
|
||||
// implicitHeight: Qt.platform.os !== "ios" ? root.height * 0.9 : screen.height * 0.77
|
||||
// Component.onCompleted: {
|
||||
// drawer.expandedHeight = implicitHeight
|
||||
// }
|
||||
|
||||
// // Connections {
|
||||
// // target: drawer
|
||||
// // enabled: !GC.isMobile()
|
||||
// // function onActiveFocusChanged() {
|
||||
// // if (drawer.activeFocus && !drawer.isOpened) {
|
||||
// // collapsed123.forceActiveFocus()
|
||||
// // // collapsedButtonChevron.forceActiveFocus()
|
||||
// // }
|
||||
// // }
|
||||
// // }
|
||||
|
||||
// ColumnLayout {
|
||||
// id: collapsed
|
||||
|
||||
// anchors.left: parent.left
|
||||
// anchors.right: parent.right
|
||||
|
||||
// Component.onCompleted: {
|
||||
// drawer.collapsedHeight = collapsed.implicitHeight
|
||||
// }
|
||||
|
||||
// DividerType {
|
||||
// Layout.topMargin: 10
|
||||
// Layout.fillWidth: false
|
||||
// Layout.preferredWidth: 20
|
||||
// Layout.preferredHeight: 2
|
||||
// Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
|
||||
// }
|
||||
|
||||
// RowLayout {
|
||||
// Layout.topMargin: 14
|
||||
// Layout.leftMargin: 24
|
||||
// Layout.rightMargin: 24
|
||||
// Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
|
||||
|
||||
// spacing: 0
|
||||
|
||||
// Connections {
|
||||
// target: drawer
|
||||
// function onEntered() {
|
||||
// if (drawer.isCollapsed) {
|
||||
// collapsedButtonChevron.backgroundColor = collapsedButtonChevron.hoveredColor
|
||||
// collapsedButtonHeader.opacity = 0.8
|
||||
// } else {
|
||||
// collapsedButtonHeader.opacity = 1
|
||||
// }
|
||||
// }
|
||||
|
||||
// function onExited() {
|
||||
// if (drawer.isCollapsed) {
|
||||
// collapsedButtonChevron.backgroundColor = collapsedButtonChevron.defaultColor
|
||||
// collapsedButtonHeader.opacity = 1
|
||||
// } else {
|
||||
// collapsedButtonHeader.opacity = 1
|
||||
// }
|
||||
// }
|
||||
|
||||
// function onPressed(pressed, entered) {
|
||||
// if (drawer.isCollapsed) {
|
||||
// collapsedButtonChevron.backgroundColor = pressed ? collapsedButtonChevron.pressedColor : entered ? collapsedButtonChevron.hoveredColor : collapsedButtonChevron.defaultColor
|
||||
// collapsedButtonHeader.opacity = 0.7
|
||||
// } else {
|
||||
// collapsedButtonHeader.opacity = 1
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
// Header1TextType {
|
||||
// id: collapsedButtonHeader
|
||||
// Layout.maximumWidth: drawer.width - 48 - 18 - 12
|
||||
|
||||
// maximumLineCount: 2
|
||||
// elide: Qt.ElideRight
|
||||
|
||||
// text: ServersModel.defaultServerName
|
||||
// horizontalAlignment: Qt.AlignHCenter
|
||||
|
||||
// Behavior on opacity {
|
||||
// PropertyAnimation { duration: 200 }
|
||||
// }
|
||||
// }
|
||||
|
||||
// ImageButtonType {
|
||||
// id: collapsedButtonChevron
|
||||
|
||||
// Layout.leftMargin: 8
|
||||
|
||||
// visible: drawer.isCollapsed
|
||||
|
||||
// hoverEnabled: false
|
||||
// image: "qrc:/images/controls/chevron-down.svg"
|
||||
// imageColor: AmneziaStyle.color.white
|
||||
|
||||
// icon.width: 18
|
||||
// icon.height: 18
|
||||
// backgroundRadius: 16
|
||||
// horizontalPadding: 4
|
||||
// topPadding: 4
|
||||
// bottomPadding: 3
|
||||
|
||||
// Keys.onEnterPressed: collapsedButtonChevron.clicked()
|
||||
// Keys.onReturnPressed: collapsedButtonChevron.clicked()
|
||||
// // Keys.onTabPressed: lastItemTabClicked()
|
||||
|
||||
// focus: true
|
||||
|
||||
// onClicked: {
|
||||
// if (drawer.isCollapsed) {
|
||||
// drawer.open()
|
||||
// focusItem1.forceActiveFocus()
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
// LabelTextType {
|
||||
// id: collapsedServerMenuDescription
|
||||
// Layout.bottomMargin: drawer.isCollapsed ? 44 : ServersModel.isDefaultServerFromApi ? 89 : 44
|
||||
// Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
|
||||
// text: drawer.isCollapsed ? ServersModel.defaultServerDescriptionCollapsed : ServersModel.defaultServerDescriptionExpanded
|
||||
// }
|
||||
// }
|
||||
|
||||
// // Connections {
|
||||
// // target: drawer
|
||||
// // enabled: !GC.isMobile()
|
||||
// // function onIsCollapsedChanged() {
|
||||
// // if (!drawer.isCollapsed) {
|
||||
// // focusItem1.forceActiveFocus()
|
||||
// // }
|
||||
// // }
|
||||
// // }
|
||||
|
||||
// ColumnLayout {
|
||||
// id: serversMenuHeader
|
||||
|
||||
// anchors.top: collapsed.bottom
|
||||
// anchors.right: parent.right
|
||||
// anchors.left: parent.left
|
||||
|
||||
// RowLayout {
|
||||
// Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
|
||||
// focus: false
|
||||
// spacing: 8
|
||||
|
||||
// visible: !ServersModel.isDefaultServerFromApi
|
||||
|
||||
// Item {
|
||||
// id: focusItem1
|
||||
// KeyNavigation.tab: serversMenuContent /*containersDropDown*/
|
||||
// }
|
||||
|
||||
// // DropDownType {
|
||||
// // id: containersDropDown
|
||||
|
||||
// // rootButtonImageColor: AmneziaStyle.color.black
|
||||
// // rootButtonBackgroundColor: AmneziaStyle.color.white
|
||||
// // rootButtonBackgroundHoveredColor: Qt.rgba(215, 216, 219, 0.8)
|
||||
// // rootButtonBackgroundPressedColor: Qt.rgba(215, 216, 219, 0.65)
|
||||
// // rootButtonHoveredBorderColor: AmneziaStyle.color.transparent
|
||||
// // rootButtonDefaultBorderColor: AmneziaStyle.color.transparent
|
||||
// // rootButtonTextTopMargin: 8
|
||||
// // rootButtonTextBottomMargin: 8
|
||||
|
||||
// // text: ServersModel.defaultServerDefaultContainerName
|
||||
// // textColor: AmneziaStyle.color.black
|
||||
// // headerText: qsTr("VPN protocol")
|
||||
// // headerBackButtonImage: "qrc:/images/controls/arrow-left.svg"
|
||||
|
||||
// // rootButtonClickedFunction: function() {
|
||||
// // containersDropDown.open()
|
||||
// // }
|
||||
|
||||
// // drawerParent: root
|
||||
// // KeyNavigation.tab: serversMenuContent
|
||||
|
||||
// // listView: HomeContainersListView {
|
||||
// // id: containersListView
|
||||
// // rootWidth: root.width
|
||||
// // // onVisibleChanged: {
|
||||
// // // if (containersDropDown.visible && !GC.isMobile()) {
|
||||
// // // focusItem1.forceActiveFocus()
|
||||
// // // }
|
||||
// // // }
|
||||
|
||||
// // Connections {
|
||||
// // target: ServersModel
|
||||
|
||||
// // function onDefaultServerIndexChanged() {
|
||||
// // updateContainersModelFilters()
|
||||
// // }
|
||||
// // }
|
||||
|
||||
// // function updateContainersModelFilters() {
|
||||
// // if (ServersModel.isDefaultServerHasWriteAccess()) {
|
||||
// // proxyDefaultServerContainersModel.filters = ContainersModelFilters.getWriteAccessProtocolsListFilters()
|
||||
// // } else {
|
||||
// // proxyDefaultServerContainersModel.filters = ContainersModelFilters.getReadAccessProtocolsListFilters()
|
||||
// // }
|
||||
// // }
|
||||
|
||||
// // model: SortFilterProxyModel {
|
||||
// // id: proxyDefaultServerContainersModel
|
||||
// // sourceModel: DefaultServerContainersModel
|
||||
|
||||
// // sorters: [
|
||||
// // RoleSorter { roleName: "isInstalled"; sortOrder: Qt.DescendingOrder }
|
||||
// // ]
|
||||
// // }
|
||||
|
||||
// // Component.onCompleted: updateContainersModelFilters()
|
||||
// // }
|
||||
// // }
|
||||
|
||||
// }
|
||||
|
||||
// Header2Type {
|
||||
// Layout.fillWidth: true
|
||||
// Layout.topMargin: 48
|
||||
// Layout.leftMargin: 16
|
||||
// Layout.rightMargin: 16
|
||||
|
||||
// headerText: qsTr("Servers")
|
||||
// }
|
||||
// }
|
||||
|
||||
// ButtonGroup {
|
||||
// id: serversRadioButtonGroup
|
||||
// }
|
||||
|
||||
// ListView {
|
||||
// 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()
|
||||
|
||||
// KeyNavigation.tab: serverInfoButton
|
||||
// }
|
||||
|
||||
// ImageButtonType {
|
||||
// id: serverInfoButton
|
||||
// image: "qrc:/images/controls/settings.svg"
|
||||
// imageColor: AmneziaStyle.color.white
|
||||
|
||||
// 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
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
// }
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,8 +16,6 @@ import "../Components"
|
||||
PageType {
|
||||
id: root
|
||||
|
||||
defaultActiveFocusItem: listview.currentItem.portTextField.textField
|
||||
|
||||
Item {
|
||||
id: focusItem
|
||||
onFocusChanged: {
|
||||
|
||||
@@ -15,12 +15,7 @@ import "../Components"
|
||||
PageType {
|
||||
id: root
|
||||
|
||||
defaultActiveFocusItem: listview.currentItem.trafficFromField.textField
|
||||
|
||||
Item {
|
||||
id: focusItem
|
||||
KeyNavigation.tab: backButton
|
||||
}
|
||||
// defaultActiveFocusItem: listview.currentItem.trafficFromField.textField
|
||||
|
||||
ColumnLayout {
|
||||
id: backButtonLayout
|
||||
@@ -183,7 +178,6 @@ PageType {
|
||||
Layout.bottomMargin: 24
|
||||
|
||||
text: qsTr("Save")
|
||||
Keys.onTabPressed: lastItemTabClicked(focusItem)
|
||||
|
||||
clickedFunc: function() {
|
||||
forceActiveFocus()
|
||||
|
||||
@@ -17,7 +17,7 @@ import "../Components"
|
||||
PageType {
|
||||
id: root
|
||||
|
||||
defaultActiveFocusItem: listview.currentItem.vpnAddressSubnetTextField.textField
|
||||
// defaultActiveFocusItem: listview.currentItem.vpnAddressSubnetTextField.textField
|
||||
|
||||
Item {
|
||||
id: focusItem
|
||||
|
||||
@@ -19,13 +19,6 @@ import "../Components"
|
||||
PageType {
|
||||
id: root
|
||||
|
||||
defaultActiveFocusItem: focusItem
|
||||
|
||||
Item {
|
||||
id: focusItem
|
||||
KeyNavigation.tab: backButton
|
||||
}
|
||||
|
||||
ColumnLayout {
|
||||
id: header
|
||||
|
||||
@@ -122,7 +115,7 @@ PageType {
|
||||
|
||||
onClosed: {
|
||||
if (!GC.isMobile()) {
|
||||
defaultActiveFocusItem.forceActiveFocus()
|
||||
// defaultActiveFocusItem.forceActiveFocus()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -226,7 +219,6 @@ PageType {
|
||||
text: qsTr("Remove ") + ContainersModel.getProcessedContainerName()
|
||||
textColor: AmneziaStyle.color.red
|
||||
|
||||
Keys.onTabPressed: lastItemTabClicked(focusItem)
|
||||
clickedFunction: function() {
|
||||
var headerText = qsTr("Remove %1 from server?").arg(ContainersModel.getProcessedContainerName())
|
||||
var descriptionText = qsTr("All users with whom you shared a connection with will no longer be able to connect to it.")
|
||||
@@ -239,7 +231,7 @@ PageType {
|
||||
}
|
||||
var noButtonFunction = function() {
|
||||
if (!GC.isMobile()) {
|
||||
focusItem.forceActiveFocus()
|
||||
// focusItem.forceActiveFocus()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -15,9 +15,9 @@ import "../Components"
|
||||
PageType {
|
||||
id: root
|
||||
|
||||
defaultActiveFocusItem: listview.currentItem.focusItemId.enabled ?
|
||||
listview.currentItem.focusItemId.textField :
|
||||
focusItem
|
||||
// defaultActiveFocusItem: listview.currentItem.focusItemId.enabled ?
|
||||
// listview.currentItem.focusItemId.textField :
|
||||
// focusItem
|
||||
|
||||
Item {
|
||||
id: focusItem
|
||||
|
||||
@@ -15,8 +15,6 @@ import "../Components"
|
||||
PageType {
|
||||
id: root
|
||||
|
||||
defaultActiveFocusItem: listview
|
||||
|
||||
Item {
|
||||
id: focusItem
|
||||
KeyNavigation.tab: backButton
|
||||
|
||||
@@ -16,8 +16,6 @@ import "../Components"
|
||||
PageType {
|
||||
id: root
|
||||
|
||||
defaultActiveFocusItem: listview
|
||||
|
||||
Item {
|
||||
id: focusItem
|
||||
KeyNavigation.tab: backButton
|
||||
|
||||
@@ -16,8 +16,6 @@ import "../Components"
|
||||
PageType {
|
||||
id: root
|
||||
|
||||
defaultActiveFocusItem: focusItem
|
||||
|
||||
Item {
|
||||
id: focusItem
|
||||
KeyNavigation.tab: backButton
|
||||
|
||||
@@ -16,8 +16,6 @@ import "../Components"
|
||||
PageType {
|
||||
id: root
|
||||
|
||||
defaultActiveFocusItem: focusItem
|
||||
|
||||
Connections {
|
||||
target: InstallController
|
||||
|
||||
|
||||
@@ -16,8 +16,6 @@ import "../Components"
|
||||
PageType {
|
||||
id: root
|
||||
|
||||
defaultActiveFocusItem: listview
|
||||
|
||||
Connections {
|
||||
target: InstallController
|
||||
|
||||
|
||||
@@ -17,8 +17,6 @@ import "../Components"
|
||||
PageType {
|
||||
id: root
|
||||
|
||||
defaultActiveFocusItem: focusItem
|
||||
|
||||
Connections {
|
||||
target: InstallController
|
||||
|
||||
|
||||
@@ -13,8 +13,6 @@ import "../Config"
|
||||
PageType {
|
||||
id: root
|
||||
|
||||
defaultActiveFocusItem: account
|
||||
|
||||
FlickableType {
|
||||
id: fl
|
||||
anchors.top: parent.top
|
||||
|
||||
@@ -14,8 +14,6 @@ import "../Components"
|
||||
PageType {
|
||||
id: root
|
||||
|
||||
defaultActiveFocusItem: backButton
|
||||
|
||||
BackButtonType {
|
||||
id: backButton
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -267,7 +253,6 @@ PageType {
|
||||
textFieldPlaceholderText: qsTr("application name")
|
||||
buttonImageSource: "qrc:/images/controls/plus.svg"
|
||||
|
||||
Keys.onTabPressed: lastItemTabClicked(focusItem)
|
||||
rightButtonClickedOnEnter: true
|
||||
|
||||
clickedFunc: function() {
|
||||
|
||||
@@ -14,7 +14,6 @@ import "../Components"
|
||||
PageType {
|
||||
id: root
|
||||
|
||||
defaultActiveFocusItem: backButton
|
||||
|
||||
BackButtonType {
|
||||
id: backButton
|
||||
@@ -231,12 +230,12 @@ PageType {
|
||||
}
|
||||
|
||||
if (!GC.isMobile()) {
|
||||
root.defaultActiveFocusItem.forceActiveFocus()
|
||||
// root.defaultActiveFocusItem.forceActiveFocus()
|
||||
}
|
||||
}
|
||||
var noButtonFunction = function() {
|
||||
if (!GC.isMobile()) {
|
||||
root.defaultActiveFocusItem.forceActiveFocus()
|
||||
// root.defaultActiveFocusItem.forceActiveFocus()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -17,8 +17,6 @@ import "../Controls2/TextTypes"
|
||||
PageType {
|
||||
id: root
|
||||
|
||||
defaultActiveFocusItem: backButton
|
||||
|
||||
Connections {
|
||||
target: SettingsController
|
||||
|
||||
|
||||
@@ -11,8 +11,6 @@ import "../Config"
|
||||
PageType {
|
||||
id: root
|
||||
|
||||
defaultActiveFocusItem: backButton
|
||||
|
||||
property bool isAppSplitTinnelingEnabled: Qt.platform.os === "windows" || Qt.platform.os === "android"
|
||||
|
||||
BackButtonType {
|
||||
|
||||
@@ -14,8 +14,6 @@ import "../Components"
|
||||
PageType {
|
||||
id: root
|
||||
|
||||
defaultActiveFocusItem: primaryDns.textField
|
||||
|
||||
Item {
|
||||
id: focusItem
|
||||
KeyNavigation.tab: backButton
|
||||
@@ -29,7 +27,7 @@ PageType {
|
||||
anchors.right: parent.right
|
||||
anchors.topMargin: 20
|
||||
|
||||
KeyNavigation.tab: root.defaultActiveFocusItem
|
||||
// KeyNavigation.tab: root.defaultActiveFocusItem
|
||||
}
|
||||
|
||||
FlickableType {
|
||||
@@ -124,12 +122,12 @@ 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()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -16,8 +16,6 @@ import "../Controls2/TextTypes"
|
||||
PageType {
|
||||
id: root
|
||||
|
||||
defaultActiveFocusItem: backButton
|
||||
|
||||
Connections {
|
||||
target: SettingsController
|
||||
|
||||
|
||||
@@ -19,8 +19,6 @@ import "../Components"
|
||||
PageType {
|
||||
id: root
|
||||
|
||||
defaultActiveFocusItem: focusItem
|
||||
|
||||
Connections {
|
||||
target: PageController
|
||||
|
||||
|
||||
@@ -21,8 +21,6 @@ PageType {
|
||||
|
||||
property bool isClearCacheVisible: ServersModel.isProcessedServerHasWriteAccess() && !ContainersModel.isServiceContainer(ContainersModel.getProcessedContainerIndex())
|
||||
|
||||
defaultActiveFocusItem: focusItem
|
||||
|
||||
Item {
|
||||
id: focusItem
|
||||
KeyNavigation.tab: backButton
|
||||
|
||||
@@ -17,8 +17,6 @@ import "../Components"
|
||||
PageType {
|
||||
id: root
|
||||
|
||||
defaultActiveFocusItem: backButton
|
||||
|
||||
ColumnLayout {
|
||||
id: header
|
||||
|
||||
|
||||
@@ -23,8 +23,6 @@ PageType {
|
||||
|
||||
property var isServerFromApi: ServersModel.getDefaultServerData("isServerFromApi")
|
||||
|
||||
defaultActiveFocusItem: searchField.textField
|
||||
|
||||
Item {
|
||||
id: focusItem
|
||||
KeyNavigation.tab: backButton
|
||||
@@ -360,11 +358,11 @@ PageType {
|
||||
anchors.fill: parent
|
||||
expandedHeight: parent.height * 0.4375
|
||||
|
||||
onClosed: {
|
||||
if (root.defaultActiveFocusItem && !GC.isMobile()) {
|
||||
root.defaultActiveFocusItem.forceActiveFocus()
|
||||
}
|
||||
}
|
||||
// onClosed: {
|
||||
// if (root.defaultActiveFocusItem && !GC.isMobile()) {
|
||||
// root.defaultActiveFocusItem.forceActiveFocus()
|
||||
// }
|
||||
// }
|
||||
|
||||
expandedContent: ColumnLayout {
|
||||
id: moreActionsDrawerContent
|
||||
|
||||
@@ -12,7 +12,6 @@ import "../Config"
|
||||
|
||||
PageType {
|
||||
id: root
|
||||
defaultActiveFocusItem: backButton
|
||||
|
||||
Connections {
|
||||
target: ImportController
|
||||
|
||||
@@ -12,13 +12,6 @@ import "../Controls2/TextTypes"
|
||||
PageType {
|
||||
id: root
|
||||
|
||||
defaultActiveFocusItem: hostname.textField
|
||||
|
||||
Item {
|
||||
id: focusItem
|
||||
KeyNavigation.tab: backButton
|
||||
}
|
||||
|
||||
BackButtonType {
|
||||
id: backButton
|
||||
|
||||
@@ -26,8 +19,6 @@ PageType {
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.topMargin: 20
|
||||
|
||||
KeyNavigation.tab: hostname.textField
|
||||
}
|
||||
|
||||
FlickableType {
|
||||
@@ -67,7 +58,7 @@ PageType {
|
||||
textField.text = textField.text.replace(/^\s+|\s+$/g, '')
|
||||
}
|
||||
|
||||
KeyNavigation.tab: username.textField
|
||||
// KeyNavigation.stab: username.textField
|
||||
}
|
||||
|
||||
TextFieldWithHeaderType {
|
||||
@@ -81,7 +72,7 @@ PageType {
|
||||
textField.text = textField.text.replace(/^\s+|\s+$/g, '')
|
||||
}
|
||||
|
||||
KeyNavigation.tab: secretData.textField
|
||||
// KeyNavigation.tab: secretData.textField
|
||||
}
|
||||
|
||||
TextFieldWithHeaderType {
|
||||
@@ -103,7 +94,7 @@ PageType {
|
||||
textField.text = textField.text.replace(/^\s+|\s+$/g, '')
|
||||
}
|
||||
|
||||
KeyNavigation.tab: continueButton
|
||||
// KeyNavigation.tab: continueButton
|
||||
}
|
||||
|
||||
BasicButtonType {
|
||||
@@ -114,7 +105,7 @@ PageType {
|
||||
|
||||
text: qsTr("Continue")
|
||||
|
||||
Keys.onTabPressed: lastItemTabClicked(focusItem)
|
||||
// Keys.onTabPressed: lastItemTabClicked()
|
||||
|
||||
clickedFunc: function() {
|
||||
forceActiveFocus()
|
||||
|
||||
@@ -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,6 @@ PageType {
|
||||
implicitWidth: parent.width
|
||||
|
||||
text: qsTr("Continue")
|
||||
KeyNavigation.tab: setupLaterButton
|
||||
parentFlickable: fl
|
||||
|
||||
clickedFunc: function() {
|
||||
@@ -193,7 +181,6 @@ PageType {
|
||||
textColor: AmneziaStyle.color.white
|
||||
borderWidth: 1
|
||||
|
||||
Keys.onTabPressed: lastItemTabClicked(focusItem)
|
||||
parentFlickable: fl
|
||||
|
||||
visible: {
|
||||
|
||||
@@ -13,7 +13,6 @@ import "../Config"
|
||||
|
||||
PageType {
|
||||
id: root
|
||||
|
||||
Component.onCompleted: PageController.disableTabBar(true)
|
||||
Component.onDestruction: PageController.disableTabBar(false)
|
||||
|
||||
|
||||
@@ -113,7 +113,7 @@ PageType {
|
||||
parent: root
|
||||
onClosed: {
|
||||
if (!GC.isMobile()) {
|
||||
defaultActiveFocusItem.forceActiveFocus()
|
||||
// defaultActiveFocusItem.forceActiveFocus()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -288,10 +288,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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,13 +14,6 @@ import "../Config"
|
||||
PageType {
|
||||
id: root
|
||||
|
||||
defaultActiveFocusItem: focusItem
|
||||
|
||||
Item {
|
||||
id: focusItem
|
||||
KeyNavigation.tab: backButton
|
||||
}
|
||||
|
||||
SortFilterProxyModel {
|
||||
id: proxyContainersModel
|
||||
sourceModel: ContainersModel
|
||||
|
||||
@@ -13,11 +13,10 @@ import "../Components"
|
||||
|
||||
PageType {
|
||||
id: root
|
||||
objectName: "PageStart"
|
||||
|
||||
property bool isControlsDisabled: false
|
||||
|
||||
defaultActiveFocusItem: startButton
|
||||
|
||||
Connections {
|
||||
target: PageController
|
||||
|
||||
@@ -178,12 +177,13 @@ PageType {
|
||||
|
||||
ConnectionTypeSelectionDrawer {
|
||||
id: connectionTypeSelection
|
||||
parentPage: root
|
||||
|
||||
onClosed: {
|
||||
// onClosed: {
|
||||
// PageController.forceTabBarActiveFocus()
|
||||
// root.defaultActiveFocusItem.forceActiveFocus()
|
||||
PageController.forceStackActiveFocus()
|
||||
}
|
||||
// PageController.forceStackActiveFocus()
|
||||
|
||||
// startButton2.forceActiveFocus()
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,14 +12,6 @@ import "../Config"
|
||||
PageType {
|
||||
id: root
|
||||
|
||||
defaultActiveFocusItem: textKey.textField
|
||||
|
||||
|
||||
Item {
|
||||
id: focusItem
|
||||
KeyNavigation.tab: backButton
|
||||
}
|
||||
|
||||
FlickableType {
|
||||
id: fl
|
||||
anchors.top: parent.top
|
||||
@@ -38,7 +30,6 @@ PageType {
|
||||
BackButtonType {
|
||||
id: backButton
|
||||
Layout.topMargin: 20
|
||||
KeyNavigation.tab: textKey.textField
|
||||
}
|
||||
|
||||
HeaderType {
|
||||
@@ -66,8 +57,6 @@ PageType {
|
||||
textField.text = ""
|
||||
textField.paste()
|
||||
}
|
||||
|
||||
KeyNavigation.tab: continueButton
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -83,7 +72,6 @@ PageType {
|
||||
anchors.bottomMargin: 32
|
||||
|
||||
text: qsTr("Continue")
|
||||
Keys.onTabPressed: lastItemTabClicked(focusItem)
|
||||
|
||||
clickedFunc: function() {
|
||||
if (ImportController.extractConfigFromData(textKey.textFieldText)) {
|
||||
|
||||
@@ -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 {
|
||||
@@ -192,8 +183,6 @@ PageType {
|
||||
anchors.rightMargin: 16
|
||||
anchors.leftMargin: 16
|
||||
|
||||
Keys.onTabPressed: lastItemTabClicked(focusItem)
|
||||
|
||||
BasicButtonType {
|
||||
id: connectButton
|
||||
Layout.fillWidth: true
|
||||
|
||||
@@ -18,8 +18,6 @@ import "../Config"
|
||||
PageType {
|
||||
id: root
|
||||
|
||||
defaultActiveFocusItem: clientNameTextField.textField
|
||||
|
||||
enum ConfigType {
|
||||
AmneziaConnection,
|
||||
OpenVpn,
|
||||
@@ -288,7 +286,7 @@ PageType {
|
||||
implicitWidth: (root.width - 32) / 2
|
||||
text: qsTr("Connection")
|
||||
|
||||
KeyNavigation.tab: usersRadioButton
|
||||
// KeyNavigation.tab: usersRadioButton
|
||||
|
||||
onClicked: {
|
||||
accessTypeSelector.currentIndex = 0
|
||||
@@ -305,7 +303,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
|
||||
@@ -343,7 +341,7 @@ PageType {
|
||||
|
||||
checkEmptyText: true
|
||||
|
||||
KeyNavigation.tab: serverSelector
|
||||
// KeyNavigation.tab: serverSelector
|
||||
|
||||
}
|
||||
|
||||
@@ -409,7 +407,7 @@ PageType {
|
||||
}
|
||||
}
|
||||
|
||||
KeyNavigation.tab: protocolSelector
|
||||
// KeyNavigation.tab: protocolSelector
|
||||
}
|
||||
|
||||
DropDownType {
|
||||
@@ -509,11 +507,11 @@ PageType {
|
||||
}
|
||||
}
|
||||
|
||||
KeyNavigation.tab: accessTypeSelector.currentIndex === 0 ?
|
||||
exportTypeSelector :
|
||||
isSearchBarVisible ?
|
||||
searchTextField.textField :
|
||||
usersHeader.actionButton
|
||||
// KeyNavigation.tab: accessTypeSelector.currentIndex === 0 ?
|
||||
// exportTypeSelector :
|
||||
// isSearchBarVisible ?
|
||||
// searchTextField.textField :
|
||||
// usersHeader.actionButton
|
||||
}
|
||||
|
||||
DropDownType {
|
||||
|
||||
@@ -18,13 +18,6 @@ import "../Config"
|
||||
PageType {
|
||||
id: root
|
||||
|
||||
defaultActiveFocusItem: focusItem
|
||||
|
||||
Item {
|
||||
id: focusItem
|
||||
KeyNavigation.tab: backButton
|
||||
}
|
||||
|
||||
BackButtonType {
|
||||
id: backButton
|
||||
|
||||
@@ -32,8 +25,6 @@ PageType {
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.topMargin: 20
|
||||
|
||||
KeyNavigation.tab: serverSelector
|
||||
}
|
||||
|
||||
FlickableType {
|
||||
@@ -85,8 +76,6 @@ PageType {
|
||||
descriptionText: qsTr("Server")
|
||||
headerText: qsTr("Server")
|
||||
|
||||
KeyNavigation.tab: shareButton
|
||||
|
||||
listView: ListViewWithRadioButtonType {
|
||||
id: serverSelectorListView
|
||||
|
||||
@@ -137,8 +126,6 @@ PageType {
|
||||
text: qsTr("Share")
|
||||
imageSource: "qrc:/images/controls/share-2.svg"
|
||||
|
||||
Keys.onTabPressed: lastItemTabClicked(focusItem)
|
||||
|
||||
clickedFunc: function() {
|
||||
shareConnectionDrawer.headerText = qsTr("Connection to ") + serverSelector.text
|
||||
shareConnectionDrawer.configContentHeaderText = qsTr("File with connection settings to ") + serverSelector.text
|
||||
|
||||
@@ -15,8 +15,6 @@ import "../Components"
|
||||
FocusScope {
|
||||
id: root
|
||||
|
||||
// defaultActiveFocusItem: homeTabButton
|
||||
|
||||
property bool isControlsDisabled: false
|
||||
property bool isTabBarDisabled: false
|
||||
|
||||
@@ -92,7 +90,6 @@ FocusScope {
|
||||
}
|
||||
|
||||
function onForceStackActiveFocus() {
|
||||
console.log("onForceStackActiveFocus")
|
||||
homeTabButton.focus = true
|
||||
tabBarStackView.forceActiveFocus()
|
||||
}
|
||||
@@ -176,17 +173,19 @@ FocusScope {
|
||||
|
||||
enabled: !root.isControlsDisabled
|
||||
|
||||
onActiveFocusChanged: {
|
||||
// console.log("tabBarStackView activeFocusChanged", activeFocus)
|
||||
}
|
||||
// onActiveFocusChanged: {
|
||||
// if (currentItem) {
|
||||
// currentItem.forceActiveFocus()
|
||||
// }
|
||||
// }
|
||||
|
||||
// KeyNavigation.tab: homeTabButton
|
||||
Keys.onTabPressed: tabBarStackView.currentItem.lastItemTabClicked()
|
||||
onCurrentItemChanged: {
|
||||
if (currentItem) {
|
||||
currentItem.forceActiveFocus()
|
||||
}
|
||||
}
|
||||
// Keys.onTabPressed: tabBarStackView.currentItem.lastItemTabClicked()
|
||||
// onCurrentItemChanged: {
|
||||
// if (currentItem) {
|
||||
// currentItem.forceActiveFocus()
|
||||
// }
|
||||
// }
|
||||
|
||||
function goToTabBarPage(page) {
|
||||
connectionTypeSelection.close()
|
||||
@@ -208,10 +207,6 @@ FocusScope {
|
||||
|
||||
property int previousIndex: 0
|
||||
|
||||
onActiveFocusChanged: {
|
||||
console.log("tabBar activeFocusChanged", activeFocus)
|
||||
}
|
||||
|
||||
anchors.right: parent.right
|
||||
anchors.left: parent.left
|
||||
anchors.bottom: parent.bottom
|
||||
|
||||
@@ -11,7 +11,7 @@ import "Config"
|
||||
import "Controls2"
|
||||
import "Components"
|
||||
|
||||
Window {
|
||||
Window {
|
||||
id: root
|
||||
objectName: "mainWindow"
|
||||
visible: true
|
||||
|
||||
Reference in New Issue
Block a user