-
-
Notifications
You must be signed in to change notification settings - Fork 377
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
Tabs: Remove initial space prior to Tabs
widget and around tab dividers inside
#502
Comments
i can do that, assign me |
Hey there - I'd like us wait a little bit for some feedback from users before we jump to PRs on this:
|
Tabs
widget and around tab dividers within the widget
Tabs
widget and around tab dividers within the widgetTabs
widget and around tab dividers inside
okay, what can i do i the mean while? as you have changed the title, i have done the same in my PR. can you suggest some good first issue on which i can work on? or for this issue i can do something? |
I just did a quick pass through the issues and I don't think there's a huge amount of good first issue stuff to do. Most of the current issues require a bit more research / discussion before implementing. The obvious one that might be worth looking at are documentation tasks (which require spending some time with each doc topic and assessing it. See:
I'll see if I can get a few more good first issue friendly issues written up. |
The impact of making a change to the way Tabs render would be that any end users using apps built with Ratatui would see the change (especially if they install the app via To move this issue towards a solution, we should document in this issue some basic rendering of tabs and note how each approach would change that. E.g.: Approach 1:
Approach 2:
etc. @bhavuk2002 does that sound like something that you could do? |
Uhm... somewhat im getting it but approaches are unclear i guess have implemented chanes that way already ? Am i right? |
Assuming a buffer with:
Approach 1 is from the Solution section. It removes the initial space before the tabs and changes the default divider to Tabs::new(vec!["123","456","789"]).render(area, buf); renders:
And Tabs::new(vec!["123","456","789"]).divider("x").render(area, buf); renders:
Changing things for approach 1 changes the renders of those two code to:
Approach 2
Approach 3
I'm not sure if the names of the functions make sense - consider how these would look in docs etc. Consider what would be the natural names for this feature. etc. Think about some of the choices and find some way to justify one vs another. |
okay im on it |
Tabs
widget and around tab dividers insideTabs
widget and around tab dividers inside
…i#502)) The tab widget now contains the values padding_left/padding_right and the function padding() that sets those values.
…i#502)) The widget now contains padding_left and and padding_right properties. Those values can be set with functions padding_left, padding_right, and padding all of which take Into<Line>.
…i#502))\nThe widget now contains padding_left and and padding_right properties.\nThose values can be set with functions padding_left, padding_right, and padding all of which takeInto<Line>.
The Tab widget now contains padding_left and and padding_right properties. Those values can be set with functions `padding_left()`, `padding_right()`, and `padding()` whic all accept `Into<Line>`. Fixes issue #502
This seems to be fixed in #629, closing. Feel free to reopen if I'm wrong. |
Problem
The Tabs widget creates a non configurable space prior to the beginning of the tab, and non removable spaces between the tab text and the divider. E.g. in the following, the space prior to "Inbox" and two of the spaces between "Inbox" and "Sent" are non-removable.
Both of these spaces can be got to by alternative means (rendering to an area with a margin, or changing the divider to include spaces either side of the divider)
Solution
" │ "
from"│"
and remove the excess spacesThis breaks rendering in two places:
let area = area.inner(&Margin::(new(1,0)));
.divider(" • ")
Alternatives
I think the main solution is probably reasonable - but so are the alternatives that don't break existing code, so I'd like to get consensus before implementing this.
Additional context
The text was updated successfully, but these errors were encountered: