ratatui-org / ratatui

Rust library that's all about cooking up terminal user interfaces (TUIs) 👨‍🍳🐀
https://ratatui.rs
MIT License
8.82k stars 263 forks source link

feat(borders): Add FULL and EMPTY border sets #1182

Closed joshka closed 2 weeks ago

joshka commented 2 weeks ago

border::FULL uses a full block symbol, while border::EMPTY uses an empty space. This is useful for when you need to allocate space for the border and apply the border style to a block without actually drawing a border. This makes it possible to style the entire title area or a block rather than just the title content.

use ratatui::{symbols::border, widgets::Block};
let block = Block::bordered().title("Title").border_set(border::FULL);
let block = Block::bordered().title("Title").border_set(border::EMPTY);
joshka commented 2 weeks ago

This was required in order to properly handle titles in the list example. Extracted from #1159

codecov[bot] commented 2 weeks ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 94.3%. Comparing base (cd64367) to head (b3353c3).

:exclamation: Current head b3353c3 differs from pull request most recent head 67ac29d

Please upload reports for the commit 67ac29d to get more accurate results.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1182 +/- ## ====================================== Coverage 94.3% 94.3% ====================================== Files 61 61 Lines 14750 14860 +110 ====================================== + Hits 13914 14024 +110 Misses 836 836 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.