-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
WIP ItemScrollArea #1871
base: master
Are you sure you want to change the base?
WIP ItemScrollArea #1871
Conversation
78d9e89
to
50d7d42
Compare
@emilk probably no one else is going to take a look at this, so are you interested in either version (copy to separate type, or just added method to the |
@emilk still waiting on your opinion if you would like it copied to separate widget, or as part of the existing |
Hi, sorry for the late reply, but 1400 lines of code is a lot. Before reviewing something like that it would be nice with an overview of what the code even does. |
I did not ask for review yet @emilk . This approaches the problem differently, caller only needs to know how many "blocks" there is.
|
Thanks for explaining it a bit more! I cannot really answer how I want the code structured until I feel I understand the method underlying it. I am still hoping there is a simpler way to implement it, for instance similar to how So do I get this right that scrolling 50% shows 5/10 block no matter how big the different blocks are? So even if the first 5 blocks are very small and the last 5 are really tall, the scrollbar will be at 50% when you are viewing the border between block 5 and 6? That's a pretty clever approach! If that is indeed the approach, then I think it could be implemented by using the underlying …but perhaps I'm missing some subtle things that makes this approach difficult or impossible. |
Yes you understood it correctly.
I my version:
Your Idea, or at least my understanding of it: (please fill in)
|
How would you accomplish this? How would you position block 4 so that exactly half of it is visible, given you don't know its height before it has already been painted? |
I store the height of the first block in state between frames, so I just start drawing at -50% of that height |
Closes Variable Sized Items in Scroll View.
It works but:
State
state.first_shown_item_size[d]
to not be too fast, but this can make it too slow. Any better option?ScrollArea
so it would be worth considering, if such feature can be added toScrollArea
somehow to reuse most of the code.ScrollState
trait to separate the the differences. (not sure if it looks better than