diff --git a/app/extensions/brave/locales/en-US/preferences.properties b/app/extensions/brave/locales/en-US/preferences.properties index 01185562ce7..020ae56d75d 100644 --- a/app/extensions/brave/locales/en-US/preferences.properties +++ b/app/extensions/brave/locales/en-US/preferences.properties @@ -270,6 +270,9 @@ useHardwareAcceleration=Use hardware acceleration when available * useSmoothScroll=Enable smooth scrolling * defaultZoomLevel=Default zoom level toolbarUserInterfaceScale=Toolbar and UI elements scale +swipeNavigationSensitivity=Swipe Navigation Sensitivity +fast=Fast +slow=Slow en-US=English (U.S.) nl-NL=Dutch (Netherlands) pt-BR=Portuguese (Brazil) diff --git a/app/renderer/components/main/main.js b/app/renderer/components/main/main.js index 55690dd9044..8ad959257c7 100644 --- a/app/renderer/components/main/main.js +++ b/app/renderer/components/main/main.js @@ -229,10 +229,11 @@ class Main extends ImmutableComponent { }, { passive: true }) ipc.on('scroll-touch-end', () => { - if (trackingFingers && time > 30 && Math.abs(deltaY) < 80) { - if (deltaX > 70 && isSwipeOnRightEdge) { + const threshold = getSetting(settings.SWIPE_NAV_SENSITIVITY) + if (trackingFingers && time > threshold && Math.abs(deltaY) < 80) { + if (deltaX > 80 && isSwipeOnRightEdge) { ipc.emit(messages.SHORTCUT_ACTIVE_FRAME_FORWARD) - } else if (deltaX < -70 && isSwipeOnLeftEdge) { + } else if (deltaX < -80 && isSwipeOnLeftEdge) { ipc.emit(messages.SHORTCUT_ACTIVE_FRAME_BACK) } } diff --git a/app/renderer/components/preferences/advancedTab.js b/app/renderer/components/preferences/advancedTab.js index 6900b8e71b1..b83de2319e3 100644 --- a/app/renderer/components/preferences/advancedTab.js +++ b/app/renderer/components/preferences/advancedTab.js @@ -35,6 +35,30 @@ class AdvancedTab extends ImmutableComponent { onChangeSetting={this.props.onChangeSetting} /> } + get swipeNavigationSensitivitySetting () { + if (platformUtil.isDarwin()) { + return
+ + + + + + + + +
+ } + + return null + } + render () { return
@@ -62,6 +86,8 @@ class AdvancedTab extends ImmutableComponent { + {this.swipeNavigationSensitivitySetting} + @@ -80,6 +106,19 @@ const styles = StyleSheet.create({ paddingBottom: '40px' }, + swipeNavigation: { + display: 'flex', + alignItems: 'center' + }, + + swipeNavigation__fastLabel: { + marginRight: '5px' + }, + + swipeNavigation__slowLabel: { + marginLeft: '5px' + }, + moreInfo: { display: 'flex', flex: 1, diff --git a/js/constants/appConfig.js b/js/constants/appConfig.js index 6c8985f0c5f..f3f10e715b0 100644 --- a/js/constants/appConfig.js +++ b/js/constants/appConfig.js @@ -195,6 +195,7 @@ module.exports = { 'advanced.auto-suggest-sites': true, 'advanced.hide-lower-sites': true, 'advanced.toolbar-ui-scale': 'normal', + 'advanced.swipe-swipe-nav-sensitivity': 100, 'shutdown.clear-history': false, 'shutdown.clear-downloads': false, 'shutdown.clear-cache': false, diff --git a/js/constants/settings.js b/js/constants/settings.js index 5024b1cb55b..448f65cc1e2 100644 --- a/js/constants/settings.js +++ b/js/constants/settings.js @@ -78,6 +78,7 @@ const settings = { MINIMUM_VISITS: 'advanced.minimum-visits', AUTO_SUGGEST_SITES: 'advanced.auto-suggest-sites', TOOLBAR_UI_SCALE: 'advanced.toolbar-ui-scale', + SWIPE_NAV_SENSITIVITY: 'advanced.swipe-nav-sensitivity', // Sync settings SYNC_ENABLED: 'sync.enabled', SYNC_DEVICE_NAME: 'sync.device-name',