WIP: add setting to switch elements manually

This commit is contained in:
Oliver Blanthorn 2021-04-21 11:45:35 +02:00
parent fcdcdc028f
commit a155c38d5b
No known key found for this signature in database
GPG key ID: 2BB8C36BB504BFF3
2 changed files with 14 additions and 0 deletions

View file

@ -186,6 +186,15 @@ export async function recursiveScroll(
const sameSignX = xDistance < 0 === lastX < 0
const sameSignY = yDistance < 0 === lastY < 0
const sameElement = lastFocused == currentFocused
if (
lastRecursiveScrolled &&
config.get("scrollswitch") === "manual" &&
((currentFocused && currentFocused == lastRecursiveScrolled) ||
!currentFocused)
) {
scroll(xDistance, yDistance, lastRecursiveScrolled)
return true
}
if (lastRecursiveScrolled && sameSignX && sameSignY && sameElement) {
// We're scrolling in the same direction as the previous time so
// let's try to pick up from where we left

View file

@ -763,6 +763,11 @@ export class default_config {
*/
scrollduration = 100
/**
* Whether scrolling should change elements automatically once the bottom is reached
*/
scrollswitch: "manual" | "auto" = "auto"
/**
* Where to open tabs opened with `tabopen` - to the right of the current tab, or at the end of the tabs.
*/