From 3c2dd5c0bd8dfacac3f8a9847a813ce0d7a9b1b8 Mon Sep 17 00:00:00 2001 From: Cyril Anisimov Date: Sun, 18 May 2025 22:13:26 +0200 Subject: [PATCH 1/3] refactor: update `ScrollBarType` policy to use `AsNeeded` for better usability --- client/ui/qml/Components/SettingsContainersListView.qml | 2 +- client/ui/qml/Controls2/FlickableType.qml | 1 - client/ui/qml/Controls2/ScrollBarType.qml | 2 +- client/ui/qml/Pages2/PageSettingsKillSwitchExceptions.qml | 2 +- 4 files changed, 3 insertions(+), 4 deletions(-) diff --git a/client/ui/qml/Components/SettingsContainersListView.qml b/client/ui/qml/Components/SettingsContainersListView.qml index 9e672130..4b551cbb 100644 --- a/client/ui/qml/Components/SettingsContainersListView.qml +++ b/client/ui/qml/Components/SettingsContainersListView.qml @@ -13,7 +13,7 @@ import "../Controls2" import "../Controls2/TextTypes" -ListView { +ListViewType { id: root width: parent.width diff --git a/client/ui/qml/Controls2/FlickableType.qml b/client/ui/qml/Controls2/FlickableType.qml index b3e5cabf..a6f38ac9 100644 --- a/client/ui/qml/Controls2/FlickableType.qml +++ b/client/ui/qml/Controls2/FlickableType.qml @@ -27,6 +27,5 @@ Flickable { ScrollBar.vertical: ScrollBarType { id: scrollBar - policy: fl.height >= fl.contentHeight ? ScrollBar.AlwaysOff : ScrollBar.AlwaysOn } } diff --git a/client/ui/qml/Controls2/ScrollBarType.qml b/client/ui/qml/Controls2/ScrollBarType.qml index 26e8edb6..d91431ab 100644 --- a/client/ui/qml/Controls2/ScrollBarType.qml +++ b/client/ui/qml/Controls2/ScrollBarType.qml @@ -7,5 +7,5 @@ import "../Controls2" ScrollBar { id: root - policy: parent.height >= parent.contentHeight ? ScrollBar.AlwaysOff : ScrollBar.AlwaysOn + policy: ScrollBar.AsNeeded } diff --git a/client/ui/qml/Pages2/PageSettingsKillSwitchExceptions.qml b/client/ui/qml/Pages2/PageSettingsKillSwitchExceptions.qml index 31d1721b..e1af4245 100644 --- a/client/ui/qml/Pages2/PageSettingsKillSwitchExceptions.qml +++ b/client/ui/qml/Pages2/PageSettingsKillSwitchExceptions.qml @@ -64,7 +64,7 @@ PageType { displayMarginBeginning: 40 displayMarginEnd: 40 - ScrollBar.vertical: ScrollBarType { } + ScrollBar.vertical: ScrollBarType {} footer: Item { width: listView.width From 691680adef6e8d3ed4eb1ad3129cc8a36f55e07b Mon Sep 17 00:00:00 2001 From: Cyril Anisimov Date: Tue, 10 Jun 2025 23:09:27 +0200 Subject: [PATCH 2/3] add selecting of location settings with Enter --- client/ui/qml/Pages2/PageHome.qml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/client/ui/qml/Pages2/PageHome.qml b/client/ui/qml/Pages2/PageHome.qml index 7934e5fb..f50f76b3 100644 --- a/client/ui/qml/Pages2/PageHome.qml +++ b/client/ui/qml/Pages2/PageHome.qml @@ -320,6 +320,9 @@ PageType { rightImageSource: hoverEnabled ? "qrc:/images/controls/chevron-down.svg" : "" + Keys.onEnterPressed: this.clicked() + Keys.onReturnPressed: this.clicked() + onClicked: { ServersModel.processedIndex = ServersModel.defaultIndex From d74a431e9566c1bac7335e73a87362b098d5f851 Mon Sep 17 00:00:00 2001 From: Cyril Anisimov Date: Wed, 11 Jun 2025 23:35:50 +0200 Subject: [PATCH 3/3] add handlers to enter push --- client/ui/qml/Pages2/PageHome.qml | 12 ++++++------ .../ui/qml/Pages2/PageProtocolWireGuardSettings.qml | 4 ++-- client/ui/qml/Pages2/PageProtocolXraySettings.qml | 4 ++-- client/ui/qml/Pages2/PageSettingsKillSwitch.qml | 6 ++++++ client/ui/qml/Pages2/PageSettingsSplitTunneling.qml | 4 ++-- .../ui/qml/Pages2/PageSetupWizardApiServicesList.qml | 4 ++-- client/ui/qml/Pages2/PageSetupWizardConfigSource.qml | 3 +++ client/ui/qml/Pages2/PageSetupWizardCredentials.qml | 3 +++ client/ui/qml/Pages2/PageSetupWizardEasy.qml | 6 ++++++ client/ui/qml/Pages2/PageShare.qml | 6 ++++++ 10 files changed, 38 insertions(+), 14 deletions(-) diff --git a/client/ui/qml/Pages2/PageHome.qml b/client/ui/qml/Pages2/PageHome.qml index f50f76b3..43a9df32 100644 --- a/client/ui/qml/Pages2/PageHome.qml +++ b/client/ui/qml/Pages2/PageHome.qml @@ -101,8 +101,8 @@ PageType { visible: isLoggingEnabled ? true : false text: qsTr("Logging enabled") - Keys.onEnterPressed: loggingButton.clicked() - Keys.onReturnPressed: loggingButton.clicked() + Keys.onEnterPressed: this.clicked() + Keys.onReturnPressed: this.clicked() onClicked: { PageController.goToPage(PageEnum.PageSettingsLogging) @@ -147,8 +147,8 @@ PageType { leftImageColor: "" rightImageSource: "qrc:/images/controls/chevron-down.svg" - Keys.onEnterPressed: splitTunnelingButton.clicked() - Keys.onReturnPressed: splitTunnelingButton.clicked() + Keys.onEnterPressed: this.clicked() + Keys.onReturnPressed: this.clicked() onClicked: { homeSplitTunnelingDrawer.openTriggered() @@ -276,8 +276,8 @@ PageType { topPadding: 4 bottomPadding: 3 - Keys.onEnterPressed: collapsedButtonChevron.clicked() - Keys.onReturnPressed: collapsedButtonChevron.clicked() + Keys.onEnterPressed: this.clicked() + Keys.onReturnPressed: this.clicked() onClicked: { if (drawer.isCollapsedStateActive()) { diff --git a/client/ui/qml/Pages2/PageProtocolWireGuardSettings.qml b/client/ui/qml/Pages2/PageProtocolWireGuardSettings.qml index 7b5180f3..42e7af99 100644 --- a/client/ui/qml/Pages2/PageProtocolWireGuardSettings.qml +++ b/client/ui/qml/Pages2/PageProtocolWireGuardSettings.qml @@ -158,8 +158,8 @@ PageType { showQuestionDrawer(headerText, descriptionText, yesButtonText, noButtonText, yesButtonFunction, noButtonFunction) } - Keys.onEnterPressed: saveButton.clicked() - Keys.onReturnPressed: saveButton.clicked() + Keys.onEnterPressed: this.clicked() + Keys.onReturnPressed: this.clicked() } } } diff --git a/client/ui/qml/Pages2/PageProtocolXraySettings.qml b/client/ui/qml/Pages2/PageProtocolXraySettings.qml index d22e31a2..51563303 100644 --- a/client/ui/qml/Pages2/PageProtocolXraySettings.qml +++ b/client/ui/qml/Pages2/PageProtocolXraySettings.qml @@ -145,8 +145,8 @@ PageType { focusItem.forceActiveFocus() } - Keys.onEnterPressed: basicButton.clicked() - Keys.onReturnPressed: basicButton.clicked() + Keys.onEnterPressed: this.clicked() + Keys.onReturnPressed: this.clicked() } } } diff --git a/client/ui/qml/Pages2/PageSettingsKillSwitch.qml b/client/ui/qml/Pages2/PageSettingsKillSwitch.qml index 1ffcc8cf..f02ed7b5 100644 --- a/client/ui/qml/Pages2/PageSettingsKillSwitch.qml +++ b/client/ui/qml/Pages2/PageSettingsKillSwitch.qml @@ -71,6 +71,9 @@ PageType { onClicked: function() { SettingsController.strictKillSwitchEnabled = false } + + Keys.onEnterPressed: this.clicked() + Keys.onReturnPressed: this.clicked() } DividerType {} @@ -102,6 +105,9 @@ PageType { showQuestionDrawer(headerText, descriptionText, yesButtonText, noButtonText, yesButtonFunction, noButtonFunction) } + + Keys.onEnterPressed: this.clicked() + Keys.onReturnPressed: this.clicked() } DividerType { diff --git a/client/ui/qml/Pages2/PageSettingsSplitTunneling.qml b/client/ui/qml/Pages2/PageSettingsSplitTunneling.qml index 292f903a..ee65c8d6 100644 --- a/client/ui/qml/Pages2/PageSettingsSplitTunneling.qml +++ b/client/ui/qml/Pages2/PageSettingsSplitTunneling.qml @@ -286,8 +286,8 @@ PageType { moreActionsDrawer.openTriggered() } - Keys.onReturnPressed: addSiteButtonImage.clicked() - Keys.onEnterPressed: addSiteButtonImage.clicked() + Keys.onReturnPressed: this.clicked() + Keys.onEnterPressed: this.clicked() } } diff --git a/client/ui/qml/Pages2/PageSetupWizardApiServicesList.qml b/client/ui/qml/Pages2/PageSetupWizardApiServicesList.qml index 549eb381..207c305e 100644 --- a/client/ui/qml/Pages2/PageSetupWizardApiServicesList.qml +++ b/client/ui/qml/Pages2/PageSetupWizardApiServicesList.qml @@ -91,8 +91,8 @@ PageType { } } - Keys.onEnterPressed: clicked() - Keys.onReturnPressed: clicked() + Keys.onEnterPressed: this.clicked() + Keys.onReturnPressed: this.clicked() } } } diff --git a/client/ui/qml/Pages2/PageSetupWizardConfigSource.qml b/client/ui/qml/Pages2/PageSetupWizardConfigSource.qml index 7159ab59..520dc5d3 100644 --- a/client/ui/qml/Pages2/PageSetupWizardConfigSource.qml +++ b/client/ui/qml/Pages2/PageSetupWizardConfigSource.qml @@ -234,6 +234,9 @@ PageType { leftImageSource: imageSource onClicked: { handler() } + + Keys.onEnterPressed: this.clicked() + Keys.onReturnPressed: this.clicked() } } diff --git a/client/ui/qml/Pages2/PageSetupWizardCredentials.qml b/client/ui/qml/Pages2/PageSetupWizardCredentials.qml index 63d4d5f6..fd9404e0 100644 --- a/client/ui/qml/Pages2/PageSetupWizardCredentials.qml +++ b/client/ui/qml/Pages2/PageSetupWizardCredentials.qml @@ -177,6 +177,9 @@ PageType { onClicked: { Qt.openUrlExternally(LanguageModel.getCurrentSiteUrl("starter-guide")) } + + Keys.onEnterPressed: this.clicked() + Keys.onReturnPressed: this.clicked() } } } diff --git a/client/ui/qml/Pages2/PageSetupWizardEasy.qml b/client/ui/qml/Pages2/PageSetupWizardEasy.qml index 096406e9..599464cf 100644 --- a/client/ui/qml/Pages2/PageSetupWizardEasy.qml +++ b/client/ui/qml/Pages2/PageSetupWizardEasy.qml @@ -118,6 +118,9 @@ PageType { containers.containerDefaultPort = ProtocolProps.getPortForInstall(defaultContainerProto) containers.containerDefaultTransportProto = ProtocolProps.defaultTransportProto(defaultContainerProto) } + + Keys.onEnterPressed: this.clicked() + Keys.onReturnPressed: this.clicked() } } } @@ -147,6 +150,9 @@ PageType { onClicked: function() { isEasySetup = false } + + Keys.onEnterPressed: this.clicked() + Keys.onReturnPressed: this.clicked() } BasicButtonType { diff --git a/client/ui/qml/Pages2/PageShare.qml b/client/ui/qml/Pages2/PageShare.qml index 48f74acf..df4640f1 100644 --- a/client/ui/qml/Pages2/PageShare.qml +++ b/client/ui/qml/Pages2/PageShare.qml @@ -256,6 +256,9 @@ PageType { onClicked: { accessTypeSelector.currentIndex = 0 } + + Keys.onEnterPressed: this.clicked() + Keys.onReturnPressed: this.clicked() } HorizontalRadioButton { @@ -272,6 +275,9 @@ PageType { ServersModel.getProcessedServerCredentials()) PageController.showBusyIndicator(false) } + + Keys.onEnterPressed: this.clicked() + Keys.onReturnPressed: this.clicked() } } }