Skip to content
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(block): support placing the title on bottom #36

Merged
merged 4 commits into from
Apr 13, 2023
Merged

Conversation

orhun
Copy link
Sponsor Member

@orhun orhun commented Feb 12, 2023

Upstream: #669

Description

Before you could only put the title on the top row of a block. Now you can put it on the bottom row! Revolutionary.

In the future, implementing an option for both a bottom and top title is possible, but seems unnecessary considering you could just manually have a Layout and do the work yourself at that point, and having support for title wizardry seems pointless. The farthest you could go is having an option to actually move the title everywhere; it's an easy extension and seems like something that would normally be built-in. Hence here it is; you can do top and bottom, left right and center.

Testing guidelines

When creating a Block with, say, Block::default().title(), slap on a .title_on_bottom(). Check tests/widget_block.rs for the tests, which are just a copy of the alignment tests.

Checklist

@mindoodoo mindoodoo added the enhancement New feature or request label Feb 14, 2023
@mindoodoo
Copy link
Member

@rabirabirara The test you added seems to be failing.

@Benjscho
Copy link
Contributor

I have a fix for the tests added, appears the expected behaviors were incorrectly input. Added a pull request for the branch here so this can be merged: #88

@sayanarijit
Copy link
Member

sayanarijit commented Mar 16, 2023

Merged #88 into this branch, however, note that since it's a new feature, it's still out of scope for the initial release.

@mindoodoo mindoodoo changed the title Title on bottom feat(block): title on bottom Mar 16, 2023
@mindoodoo
Copy link
Member

Seems like a small useful feature, I'm in favor of adding it in. Thoughts @sayanarijit @orhun ?

@orhun
Copy link
Sponsor Member Author

orhun commented Mar 23, 2023

Yup, I agree. (approved)

@Xithrius
Copy link
Contributor

Xithrius commented Apr 8, 2023

Thank you for implementing this feature! (Am author of fdehau/tui-rs#625)

@orhun orhun changed the title feat(block): title on bottom feat(block): support placing the title on bottom Apr 13, 2023
@orhun orhun merged commit 7adc3fe into main Apr 13, 2023
@joshka joshka deleted the 669/title_on_bottom branch July 4, 2023 21:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

6 participants