Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tap-to-scroll to the scroll bars #5349

Open
wants to merge 8 commits into
base: develop
Choose a base branch
from

Conversation

dweymouth
Copy link
Contributor

@dweymouth dweymouth commented Jan 1, 2025

Description:

Tapping above, below, left, or right of a scroll bar will scroll the content up, down, left, or right by a (nearly) full page, respectively. When the scroll bar is large, a new background rectangle is drawn behind it to indicate the taps will go to the scroller and not the underlying content.

Fixes #4922

out.mp4

Checklist:

  • Tests included.
  • Lint and formatter run with no errors.
  • Tests all pass.

@dweymouth dweymouth changed the title Add tap-to-scroll to the scroll bars. Add tap-to-scroll to the scroll bars Jan 1, 2025
@dweymouth dweymouth marked this pull request as ready for review January 2, 2025 00:04
Copy link
Member

@Jacalz Jacalz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. This is a really nice addition but I think it needs some tests before we can merge :)

@dweymouth dweymouth requested a review from Jacalz January 7, 2025 16:16
Copy link
Member

@Jacalz Jacalz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. I just tested this some more and the behaviour is not quite what I would expect. Should the scroller not go to where I ave clicked? Look at this page in the browser and you should see that clicking on the scroller moves the middle of the scroller to where it was clicked. This does not happen if you for example go to fyne_demo and the Collections -> List page.

@dweymouth
Copy link
Contributor Author

dweymouth commented Jan 7, 2025

I based it on what Firefox does. I checked with this page https://worlds-highest-website.com/ - when you tap below the scroll bar, no matter how far down, it barely moves the bar because the page is so long. I just tested with Chromium too and it does the same thing.

Edit: and same with Safari too

Edit2: Also with long Wikipedia articles where you can see where the text ends up led me to conclude that the behavior is to scroll almost a full pane, regardless of where clicked

@Jacalz
Copy link
Member

Jacalz commented Jan 7, 2025

This is how Firefox behaves on my end. It seems much more intuitive in my opinion to move to where I clicked rather than just some set of pages at a time:
Screencast From 2025-01-07 21-09-51.webm

@dweymouth
Copy link
Contributor Author

Oh no.. I guess it may be platform-specific. In which case we probably want to do the same, since we try to fit in with platform conventions. Will test browser behavior on my Linux system too, and Windows VM, but I feel like as a MacOS user, I'm already subconsciously expecting the scroll behavior I implemented here.

@Jacalz
Copy link
Member

Jacalz commented Jan 7, 2025

I feel like as a MacOS user, I'm already subconsciously expecting the scroll behavior I implemented here.

And I expect the opposite 🙈

@dweymouth
Copy link
Contributor Author

Oh, it's a MacOS system setting. Yeah, we should probably try to respect that and read it from the ObjC API, and implement your suggested behavior for all other platforms:

https://www.reddit.com/r/Windows10/comments/kjxz1v/scrollbar_jump_to_position_setting/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants