tui-rs icon indicating copy to clipboard operation
tui-rs copied to clipboard

Allow specifying margins for Paragraph widget

Open dixslyf opened this issue 3 years ago • 0 comments

Description

Margins can now be specified around the text in a Paragraph widget via the .margin(...) builder method which accepts a Margin struct. There was some discussion last year in #299 about adding margins to all widgets, though it seems like there hasn't been much progress in that respect. This PR is essentially a sibling to #319, which does the same for the Tabs widget instead.

I've only added a single test for now, though if you'd like more to test if the margins play well with other properties such as alignment and text wrapping, I'd be happy to do so!

Checklist

  • [x] I have read the contributing guidelines.
  • [x] I have added relevant tests.
  • [x] I have documented all new additions.

dixslyf avatar Jul 14 '21 03:07 dixslyf