-
Notifications
You must be signed in to change notification settings - Fork 7
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(tui-scrollview): add scrollbars visibility handling #45
Conversation
Add `ScrollbarVisibility` enum with `Automatic` (default), `Always`, and `Never` variants. Also add fluent setter methods `horizontal_scrollbar_visibility()`, `vertical_scrollbar_visibility()` and `scrollbars_visibility()` to `ScrollView`. ```rust let mut sv_no_vert = ScrollView::new(Size::new(20, 20)) .vertical_scrollbar_visibility(ScrollbarVisibility::Never); let mut sv_allways_bars = ScrollView::new(Size::new(50, 80)) .scrollbars_visibility(ScrollbarVisibility::Always); ```
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #45 +/- ##
=====================================
Coverage 0.00% 0.00%
=====================================
Files 2 2
Lines 150 190 +40
=====================================
- Misses 150 190 +40 ☔ View full report in Codecov by Sentry. 🚨 Try these New Features:
|
@joshka Tell which part of the format checks you'd want solved. It's complaining about the tests too, but I followed the format already there in the other ones. As for the scrollbars rendering, I kept returning the remaining area from |
I tweaked this for a bunch of nitpicks that are fairly opinionated preferences rather than problems with the code. It would have been annoying to communicate these, so easier to just do them:
|
Thanks for the PR on this. I'll release it in a bit. |
Thanks. Yes, it'd indeed take some more time than just doing it. You making the changes still helps me learn how you like things in case I send another PR, I appreciate it. |
Add
ScrollbarVisibility
enum withAutomatic
(default),Always
, andNever
variants. Also add fluent setter methodshorizontal_scrollbar_visibility()
,vertical_scrollbar_visibility()
andscrollbars_visibility()
toScrollView
.