-
-
Notifications
You must be signed in to change notification settings - Fork 346
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
feat(widgets): add offset() and offset_mut() for table and list state #12
Conversation
wookietreiber said: cargo make does not seem to be compatible with rustc 1.56.1:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd suggest adding the with_offset / with_selected methods to TableState to make building state in a single statement easy, but this is fine without it.
Updated the implementation so that Table and List state implementations are identical. Makes one think if we should have one struct such as e.g. |
That's kinda what the scroll RFC talks about. |
Description
Adds offset access and manipulation. Fixes #495.
Testing guidelines
I have a few structs that keep the table state. I use this
trait ScrollableTable
for each of these to attach actions like scroll up/down, etc. I've added thisfn recenter
to test offset manipulation.ListState
should be pretty much analogously.Note that I haven't added tests per se, because I think that these kinds of accessor/mutator functions are quite obvious.
Checklist