-
Notifications
You must be signed in to change notification settings - Fork 17
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 support for windowing in select #73
base: main
Are you sure you want to change the base?
Conversation
@cylewitruk It's better to move with the ultimate solution with automatic terminal size identification. |
@fadeevab alright, will have a look at that then too. I still want the windowing function so I can control the display size of the list if I want to, but using terminal size as a default will be a huge improvement 👍 I think the I'll probably expose some convenience function to get terminal size to the consumer as well, in-case they want to do their own window size caculation (could be embedded in a TUI or something). |
@fadeevab pushed |
@cylewitruk. Busy days. I hope I will review it soon. |
@fadeevab no rush 😊 |
window_size: usize, | ||
window_pos: usize, | ||
term_size: Option<Size>, |
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.
Thanks for the patch! :) I believe this part should be used in the multiselect
as well, thus I would ask to move it into a separate structure, e.g. "TermSize
", something like I did with filter.rs
for filtering in the both selection lists.
TermSize::default()
TermSize::get_size() -> usize
TermSize::set_size(usize)
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.
@fadeevab agreed, been a bit tight with time the last weeks but I'll get to this eventually 😄
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.
@cylewitruk hello, no rush :) meanwhile, we managed to release few improvements to the multiprogress bar (insert
and println
)
Offers a solution for #64 by allowing the user to specify a max window size -- works with filtering as well. See the
select_window_size
example.An ultimate solution would probably use something like termsize and calculate based on the actual size of the viewport.