diff --git a/client/ui/qml/Components/HomeContainersListView.qml b/client/ui/qml/Components/HomeContainersListView.qml index 3dc31300..337918f1 100644 --- a/client/ui/qml/Components/HomeContainersListView.qml +++ b/client/ui/qml/Components/HomeContainersListView.qml @@ -18,86 +18,15 @@ ListView { property var selectedText width: rootWidth - height: contentItem.height // TODO: It should be fixed size, not content item height + height: contentItem.height clip: true - // interactive: false - - // property FlickableType parentFlickable - // property var lastItemTabClicked - - // property int currentFocusIndex: 0 - - // snapMode: ListView.SnapToItem + snapMode: ListView.SnapToItem ScrollBar.vertical: ScrollBarType {} property bool isFocusable: true - Keys.onTabPressed: { - FocusController.nextKeyTabItem() - } - - Keys.onBacktabPressed: { - FocusController.previousKeyTabItem() - } - - Keys.onUpPressed: { - FocusController.nextKeyUpItem() - } - - Keys.onDownPressed: { - FocusController.nextKeyDownItem() - } - - Keys.onLeftPressed: { - FocusController.nextKeyLeftItem() - } - - Keys.onRightPressed: { - FocusController.nextKeyRightItem() - } - - // activeFocusOnTab: true - // onActiveFocusChanged: { - // console.log("===========================") - // positionViewAtEnd() - // parentFlickable.ensureVisible(this.itemAtIndex(6)) - // if (activeFocus) { - // this.currentFocusIndex = 0 - // this.itemAtIndex(currentFocusIndex).forceActiveFocus() - // } - // } - - // Keys.onTabPressed: { - // if (currentFocusIndex < this.count - 1) { - // currentFocusIndex += 1 - // this.itemAtIndex(currentFocusIndex).forceActiveFocus() - // } else { - // currentFocusIndex = 0 - // if (lastItemTabClicked && typeof lastItemTabClicked === "function") { - // lastItemTabClicked() - // } - // } - // } - - // onVisibleChanged: { - // if (visible) { - // currentFocusIndex = 0 - // focusItem.forceActiveFocus() - // } - // } - - // Item { - // id: focusItem - // } - - // onCurrentFocusIndexChanged: { - // if (parentFlickable) { - // parentFlickable.ensureVisible(this.itemAtIndex(currentFocusIndex)) - // } - // } - ButtonGroup { id: containersRadioButtonGroup } @@ -136,7 +65,7 @@ ListView { } if (checked) { - containersDropDown.closeTriggered() // TODO: containersDropDown is outside this file + containersDropDown.closeTriggered() ServersModel.setDefaultContainer(ServersModel.defaultIndex, proxyDefaultServerContainersModel.mapToSource(index)) } else { ContainersModel.setProcessedContainerIndex(proxyDefaultServerContainersModel.mapToSource(index)) diff --git a/client/ui/qml/Components/ServersListView.qml b/client/ui/qml/Components/ServersListView.qml index 8eccb324..dc5c5a33 100644 --- a/client/ui/qml/Components/ServersListView.qml +++ b/client/ui/qml/Components/ServersListView.qml @@ -28,11 +28,7 @@ ListView { model: ServersModel - ScrollBar.vertical: ScrollBarType { - id: scrollBar - objectName: "scrollBar" - policy: root.height >= root.contentHeight ? ScrollBar.AlwaysOff : ScrollBar.AlwaysOn - } + ScrollBar.vertical: ScrollBarType {} property bool isFocusable: true diff --git a/client/ui/qml/Components/SettingsContainersListView.qml b/client/ui/qml/Components/SettingsContainersListView.qml index b3357b9c..9e672130 100644 --- a/client/ui/qml/Components/SettingsContainersListView.qml +++ b/client/ui/qml/Components/SettingsContainersListView.qml @@ -20,16 +20,10 @@ ListView { height: root.contentItem.height clip: true - interactive: false + reuseItems: true property bool isFocusable: false - onVisibleChanged: { - if (visible) { - this.currentIndex = 0 - } - } - delegate: Item { implicitWidth: root.width implicitHeight: delegateContent.implicitHeight diff --git a/client/ui/qml/Components/ShareConnectionDrawer.qml b/client/ui/qml/Components/ShareConnectionDrawer.qml index ed50807a..f98944f0 100644 --- a/client/ui/qml/Components/ShareConnectionDrawer.qml +++ b/client/ui/qml/Components/ShareConnectionDrawer.qml @@ -61,30 +61,6 @@ DrawerType2 { property bool isFocusable: true - Keys.onTabPressed: { - FocusController.nextKeyTabItem() - } - - Keys.onBacktabPressed: { - FocusController.previousKeyTabItem() - } - - Keys.onUpPressed: { - FocusController.nextKeyUpItem() - } - - Keys.onDownPressed: { - FocusController.nextKeyDownItem() - } - - Keys.onLeftPressed: { - FocusController.nextKeyLeftItem() - } - - Keys.onRightPressed: { - FocusController.nextKeyRightItem() - } - ScrollBar.vertical: ScrollBarType {} model: 1 diff --git a/client/ui/qml/Controls2/BasicButtonType.qml b/client/ui/qml/Controls2/BasicButtonType.qml index 25ff1dab..b60e96cf 100644 --- a/client/ui/qml/Controls2/BasicButtonType.qml +++ b/client/ui/qml/Controls2/BasicButtonType.qml @@ -64,7 +64,6 @@ Button { implicitHeight: 56 hoverEnabled: true - focusPolicy: Qt.TabFocus onFocusChanged: { if (root.activeFocus) { diff --git a/client/ui/qml/Controls2/DrawerType2.qml b/client/ui/qml/Controls2/DrawerType2.qml index 04a7635c..4c9bd010 100644 --- a/client/ui/qml/Controls2/DrawerType2.qml +++ b/client/ui/qml/Controls2/DrawerType2.qml @@ -12,9 +12,6 @@ Item { readonly property string drawerExpandedStateName: "expanded" readonly property string drawerCollapsedStateName: "collapsed" - // readonly property bool isExpanded: isExpandedStateActive() - // readonly property bool isCollapsed: isCollapsedStateActive() - readonly property bool isOpened: isExpandedStateActive() || (isCollapsedStateActive && (dragArea.drag.active === true)) readonly property bool isClosed: isCollapsedStateActive() && (dragArea.drag.active === false) diff --git a/client/ui/qml/Controls2/ListViewWithRadioButtonType.qml b/client/ui/qml/Controls2/ListViewWithRadioButtonType.qml index da5561ca..eafc1f5a 100644 --- a/client/ui/qml/Controls2/ListViewWithRadioButtonType.qml +++ b/client/ui/qml/Controls2/ListViewWithRadioButtonType.qml @@ -26,6 +26,7 @@ ListView { height: root.contentItem.height clip: true + reuseItems: true property bool isFocusable: true diff --git a/client/ui/qml/Controls2/VerticalRadioButton.qml b/client/ui/qml/Controls2/VerticalRadioButton.qml index dcf0f1d9..bee8ef7b 100644 --- a/client/ui/qml/Controls2/VerticalRadioButton.qml +++ b/client/ui/qml/Controls2/VerticalRadioButton.qml @@ -55,7 +55,6 @@ RadioButton { } hoverEnabled: true - // focusPolicy: Qt.TabFocus indicator: Rectangle { id: background diff --git a/client/ui/qml/Pages2/PageProtocolRaw.qml b/client/ui/qml/Pages2/PageProtocolRaw.qml index 1a530780..03b4e297 100644 --- a/client/ui/qml/Pages2/PageProtocolRaw.qml +++ b/client/ui/qml/Pages2/PageProtocolRaw.qml @@ -67,13 +67,6 @@ PageType { activeFocusOnTab: true focus: true - onActiveFocusChanged: { - if (focus) { - listView.currentIndex = 0 - listView.currentItem.focusItem.forceActiveFocus() - } - } - delegate: Item { implicitWidth: parent.width implicitHeight: delegateContent.implicitHeight diff --git a/client/ui/qml/Pages2/PageProtocolWireGuardSettings.qml b/client/ui/qml/Pages2/PageProtocolWireGuardSettings.qml index 257bc675..8aa0b185 100644 --- a/client/ui/qml/Pages2/PageProtocolWireGuardSettings.qml +++ b/client/ui/qml/Pages2/PageProtocolWireGuardSettings.qml @@ -56,13 +56,6 @@ PageType { model: WireGuardConfigModel - // activeFocusOnTab: true - // onActiveFocusChanged: { - // if (activeFocus) { - // listview.itemAtIndex(0)?.focusItemId.forceActiveFocus() - // } - // } - delegate: Item { id: delegateItem diff --git a/client/ui/qml/Pages2/PageProtocolXraySettings.qml b/client/ui/qml/Pages2/PageProtocolXraySettings.qml index 6d53fdd3..6d2ad3d1 100644 --- a/client/ui/qml/Pages2/PageProtocolXraySettings.qml +++ b/client/ui/qml/Pages2/PageProtocolXraySettings.qml @@ -57,13 +57,6 @@ PageType { model: XrayConfigModel - // activeFocusOnTab: true - // onActiveFocusChanged: { - // if (activeFocus) { - // listview.itemAtIndex(0)?.focusItemId.forceActiveFocus() - // } - // } - delegate: Item { property alias focusItemId: textFieldWithHeaderType.textField diff --git a/client/ui/qml/Pages2/PageSettingsApiServerInfo.qml b/client/ui/qml/Pages2/PageSettingsApiServerInfo.qml index db17196a..39207486 100644 --- a/client/ui/qml/Pages2/PageSettingsApiServerInfo.qml +++ b/client/ui/qml/Pages2/PageSettingsApiServerInfo.qml @@ -104,9 +104,6 @@ PageType { descriptionOnTop: true -// parentFlickable: fl -// KeyNavigation.tab: passwordLabel.eyeButton - rightImageSource: "qrc:/images/controls/copy.svg" rightImageColor: AmneziaStyle.color.paleGray @@ -134,8 +131,6 @@ PageType { text: qsTr("Reload API config") -// Keys.onTabPressed: lastItemTabClicked(focusItem) - clickedFunc: function() { var headerText = qsTr("Reload API config?") var yesButtonText = qsTr("Continue") @@ -174,8 +169,6 @@ PageType { text: qsTr("Remove from application") -// Keys.onTabPressed: lastItemTabClicked(focusItem) - clickedFunc: function() { var headerText = qsTr("Remove from application?") var yesButtonText = qsTr("Continue") diff --git a/client/ui/qml/Pages2/PageSettingsServersList.qml b/client/ui/qml/Pages2/PageSettingsServersList.qml index 1852f9c3..17337a48 100644 --- a/client/ui/qml/Pages2/PageSettingsServersList.qml +++ b/client/ui/qml/Pages2/PageSettingsServersList.qml @@ -50,20 +50,14 @@ PageType { anchors.left: parent.left anchors.right: parent.right - height: 500 // servers.contentItem.height // TODO: calculate height + height: 500 - property bool isFocusable: true + property bool isFocusable: true model: ServersModel clip: true - interactive: false - - onVisibleChanged: { - if (visible) { - currentIndex = 0 - } - } + reuseItems: true delegate: Item { implicitWidth: servers.width diff --git a/client/ui/qml/Pages2/PageShareFullAccess.qml b/client/ui/qml/Pages2/PageShareFullAccess.qml index 8451835c..af409d72 100644 --- a/client/ui/qml/Pages2/PageShareFullAccess.qml +++ b/client/ui/qml/Pages2/PageShareFullAccess.qml @@ -18,8 +18,6 @@ import "../Config" PageType { id: root - // defaultActiveFocusItem: focusItem - BackButtonType { id: backButton