Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hey!
This pull request fixes the list scrolling.
Applying this this patch and running
go run _examples/widget_demos/list
demonstrates part of the issue.The following video shows what happens when manually scrolling to the bottom, then clicking the button to select entry 20: the scrolling to show the entry ends up with it well inside the view instead of the first element at the top of the view.
Changing this line in
_examples/widget_demos/list/main.go
to
then running the example again, and clicking the button to select entry 20, highlights another problem that cannot be captured very well in a video: the scrolling moves up and down every frame resulting in a constant blurred list view.
The fix in this pull request starts by renaming the
scrollcontainer.ContentRect
method toscrollcontainer.ViewRect
because it’s actually what it is: the rect for the current visible part of the container, not of the underlying part with all the content.It then introduces a «real»
scrollcontainer.ContentRect
method, that’s needed to properly compute the scrolling when making a widget visible in the view.The first 2 commits could probably be merged into the 4th, I can do that if needed.
Or even squash all the commits…