diff --git a/client/resources.qrc b/client/resources.qrc index a7e67e39..a049e180 100644 --- a/client/resources.qrc +++ b/client/resources.qrc @@ -160,5 +160,6 @@ ui/qml/Pages/PageQrDecoderIos.qml server_scripts/website_tor/Dockerfile ui/qml/Pages/PageViewConfig.qml + ui/qml/Controls/FlickableType.qml diff --git a/client/ui/qml/Controls/FlickableType.qml b/client/ui/qml/Controls/FlickableType.qml new file mode 100644 index 00000000..12c5eb08 --- /dev/null +++ b/client/ui/qml/Controls/FlickableType.qml @@ -0,0 +1,14 @@ +import QtQuick 2.12 +import QtQuick.Controls 2.12 + +Flickable { + id: fl + + Keys.onUpPressed: scrollBar.decrease() + Keys.onDownPressed: scrollBar.increase() + + ScrollBar.vertical: ScrollBar { + id: scrollBar + policy: fl.height > fl.contentHeight ? ScrollBar.AlwaysOff : ScrollBar.AlwaysOn + } +} diff --git a/client/ui/qml/Pages/InstallSettings/SelectContainer.qml b/client/ui/qml/Pages/InstallSettings/SelectContainer.qml index 83efaec1..8a99c7ac 100644 --- a/client/ui/qml/Pages/InstallSettings/SelectContainer.qml +++ b/client/ui/qml/Pages/InstallSettings/SelectContainer.qml @@ -50,7 +50,7 @@ Drawer { } - Flickable { + FlickableType { clip: true anchors.fill: parent contentHeight: col.height diff --git a/client/ui/qml/Pages/PageAppSetting.qml b/client/ui/qml/Pages/PageAppSetting.qml index 1b0f05c0..97ed063b 100644 --- a/client/ui/qml/Pages/PageAppSetting.qml +++ b/client/ui/qml/Pages/PageAppSetting.qml @@ -19,7 +19,7 @@ PageBase { text: qsTr("Application Settings") } - Flickable { + FlickableType { id: fl width: root.width anchors.top: caption.bottom @@ -162,10 +162,6 @@ PageBase { } } } - - ScrollBar.vertical: ScrollBar { - policy: fl.height > content.height? ScrollBar.AlwaysOff : ScrollBar.AlwaysOn - } } Logo { diff --git a/client/ui/qml/Pages/PageGeneralSettings.qml b/client/ui/qml/Pages/PageGeneralSettings.qml index 04bf4472..50b9d6c4 100644 --- a/client/ui/qml/Pages/PageGeneralSettings.qml +++ b/client/ui/qml/Pages/PageGeneralSettings.qml @@ -17,7 +17,7 @@ PageBase { z: -1 } - Flickable { + FlickableType { id: fl width: root.width anchors.top: back.bottom diff --git a/client/ui/qml/Pages/PageServerContainers.qml b/client/ui/qml/Pages/PageServerContainers.qml index 4b05568a..d61d2a7f 100644 --- a/client/ui/qml/Pages/PageServerContainers.qml +++ b/client/ui/qml/Pages/PageServerContainers.qml @@ -178,7 +178,7 @@ PageBase { - Flickable { + FlickableType { visible: container_selector.selectedIndex <= 0 clip: true width: parent.width diff --git a/client/ui/qml/Pages/PageServerList.qml b/client/ui/qml/Pages/PageServerList.qml index 7791cc05..bde343aa 100644 --- a/client/ui/qml/Pages/PageServerList.qml +++ b/client/ui/qml/Pages/PageServerList.qml @@ -176,7 +176,7 @@ PageBase { } ScrollBar.vertical: ScrollBar { - policy: ScrollBar.AlwaysOn + policy: ScrollBar.AsNeeded } } } diff --git a/client/ui/qml/Pages/PageSetupWizard.qml b/client/ui/qml/Pages/PageSetupWizard.qml index 8a13d667..b6aab471 100644 --- a/client/ui/qml/Pages/PageSetupWizard.qml +++ b/client/ui/qml/Pages/PageSetupWizard.qml @@ -19,7 +19,7 @@ PageBase { text: qsTr("Setup your server to use VPN") } - Flickable { + FlickableType { id: fl width: root.width anchors.top: caption.bottom diff --git a/client/ui/qml/Pages/PageSetupWizardHighLevel.qml b/client/ui/qml/Pages/PageSetupWizardHighLevel.qml index 1729aff0..bd8c72d6 100644 --- a/client/ui/qml/Pages/PageSetupWizardHighLevel.qml +++ b/client/ui/qml/Pages/PageSetupWizardHighLevel.qml @@ -19,7 +19,7 @@ PageBase { text: qsTr("Setup Wizard") } - Flickable { + FlickableType { id: fl width: root.width anchors.top: caption.bottom diff --git a/client/ui/qml/Pages/PageSetupWizardLowLevel.qml b/client/ui/qml/Pages/PageSetupWizardLowLevel.qml index 8b7ee744..f6c34558 100644 --- a/client/ui/qml/Pages/PageSetupWizardLowLevel.qml +++ b/client/ui/qml/Pages/PageSetupWizardLowLevel.qml @@ -19,7 +19,7 @@ PageBase { text: qsTr("Setup Wizard") } - Flickable { + FlickableType { id: fl width: root.width anchors.top: caption.bottom diff --git a/client/ui/qml/Pages/PageSetupWizardMediumLevel.qml b/client/ui/qml/Pages/PageSetupWizardMediumLevel.qml index 01721cdc..21b0e8f8 100644 --- a/client/ui/qml/Pages/PageSetupWizardMediumLevel.qml +++ b/client/ui/qml/Pages/PageSetupWizardMediumLevel.qml @@ -19,7 +19,7 @@ PageBase { text: qsTr("Setup Wizard") } - Flickable { + FlickableType { id: fl width: root.width anchors.top: caption.bottom diff --git a/client/ui/qml/Pages/PageSetupWizardVPNMode.qml b/client/ui/qml/Pages/PageSetupWizardVPNMode.qml index 2445819e..d307aacf 100644 --- a/client/ui/qml/Pages/PageSetupWizardVPNMode.qml +++ b/client/ui/qml/Pages/PageSetupWizardVPNMode.qml @@ -19,7 +19,7 @@ PageBase { text: qsTr("Setup Wizard") } - Flickable { + FlickableType { id: fl width: root.width anchors.top: caption.bottom diff --git a/client/ui/qml/Pages/PageShareConnection.qml b/client/ui/qml/Pages/PageShareConnection.qml index b643a7ee..59ca378d 100644 --- a/client/ui/qml/Pages/PageShareConnection.qml +++ b/client/ui/qml/Pages/PageShareConnection.qml @@ -28,7 +28,7 @@ PageBase { } - Flickable { + FlickableType { clip: true width: parent.width anchors.top: caption.bottom diff --git a/client/ui/qml/Pages/PageViewConfig.qml b/client/ui/qml/Pages/PageViewConfig.qml index acefb9b3..198e1a09 100644 --- a/client/ui/qml/Pages/PageViewConfig.qml +++ b/client/ui/qml/Pages/PageViewConfig.qml @@ -20,7 +20,7 @@ PageBase { text: qsTr("Check config") } - Flickable { + FlickableType { id: fl width: root.width anchors.top: caption.bottom diff --git a/client/ui/qml/Pages/Protocols/PageProtoOpenVPN.qml b/client/ui/qml/Pages/Protocols/PageProtoOpenVPN.qml index 9c00172c..67a095fb 100644 --- a/client/ui/qml/Pages/Protocols/PageProtoOpenVPN.qml +++ b/client/ui/qml/Pages/Protocols/PageProtoOpenVPN.qml @@ -19,7 +19,7 @@ PageProtocolBase { text: qsTr("OpenVPN Settings") } - Flickable { + FlickableType { id: fl width: root.width anchors.top: caption.bottom diff --git a/client/ui/qml/Pages/Share/PageShareProtoAmnezia.qml b/client/ui/qml/Pages/Share/PageShareProtoAmnezia.qml index 2afecbad..9de5d5b3 100644 --- a/client/ui/qml/Pages/Share/PageShareProtoAmnezia.qml +++ b/client/ui/qml/Pages/Share/PageShareProtoAmnezia.qml @@ -18,7 +18,7 @@ PageShareProtocolBase { text: qsTr("Share for Amnezia") } - Flickable { + FlickableType { id: fl width: root.width anchors.top: caption.bottom diff --git a/client/ui/qml/Pages/Share/PageShareProtoCloak.qml b/client/ui/qml/Pages/Share/PageShareProtoCloak.qml index fe92c1e7..0ba7d1ee 100644 --- a/client/ui/qml/Pages/Share/PageShareProtoCloak.qml +++ b/client/ui/qml/Pages/Share/PageShareProtoCloak.qml @@ -18,7 +18,7 @@ PageShareProtocolBase { text: qsTr("Share Cloak Settings") } - Flickable { + FlickableType { id: fl width: root.width anchors.top: caption.bottom diff --git a/client/ui/qml/Pages/Share/PageShareProtoIkev2.qml b/client/ui/qml/Pages/Share/PageShareProtoIkev2.qml index ffa300aa..1c44b2cb 100644 --- a/client/ui/qml/Pages/Share/PageShareProtoIkev2.qml +++ b/client/ui/qml/Pages/Share/PageShareProtoIkev2.qml @@ -42,7 +42,7 @@ PageShareProtocolBase { visible: false } - Flickable { + FlickableType { id: fl width: root.width anchors.top: caption.bottom diff --git a/client/ui/qml/Pages/Share/PageShareProtoOpenVPN.qml b/client/ui/qml/Pages/Share/PageShareProtoOpenVPN.qml index ab4a9a3d..67a91775 100644 --- a/client/ui/qml/Pages/Share/PageShareProtoOpenVPN.qml +++ b/client/ui/qml/Pages/Share/PageShareProtoOpenVPN.qml @@ -18,7 +18,7 @@ PageShareProtocolBase { text: qsTr("Share OpenVPN Settings") } - Flickable { + FlickableType { id: fl width: root.width anchors.top: caption.bottom diff --git a/client/ui/qml/Pages/Share/PageShareProtoShadowSocks.qml b/client/ui/qml/Pages/Share/PageShareProtoShadowSocks.qml index f8d83ae3..9956609b 100644 --- a/client/ui/qml/Pages/Share/PageShareProtoShadowSocks.qml +++ b/client/ui/qml/Pages/Share/PageShareProtoShadowSocks.qml @@ -18,7 +18,7 @@ PageShareProtocolBase { text: qsTr("Share ShadowSocks Settings") } - Flickable { + FlickableType { id: fl width: root.width anchors.top: caption.bottom diff --git a/client/ui/qml/Pages/Share/PageShareProtoWireGuard.qml b/client/ui/qml/Pages/Share/PageShareProtoWireGuard.qml index 336964ac..f9f98a6a 100644 --- a/client/ui/qml/Pages/Share/PageShareProtoWireGuard.qml +++ b/client/ui/qml/Pages/Share/PageShareProtoWireGuard.qml @@ -18,7 +18,7 @@ PageShareProtocolBase { text: qsTr("Share WireGuard Settings") } - Flickable { + FlickableType { id: fl width: root.width anchors.top: caption.bottom