Skip to content

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

Merged
joshka merged 2 commits intomainfrom
jm/more-borders
Jun 18, 2024
Merged

feat(borders): Add FULL and EMPTY border sets#1182
joshka merged 2 commits intomainfrom
jm/more-borders

Conversation

@joshka
Copy link
Copy Markdown
Member

@joshka joshka commented Jun 16, 2024

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
Copy link
Copy Markdown
Member Author

joshka commented Jun 16, 2024

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

Comment thread src/symbols.rs Outdated
Comment thread src/symbols.rs Outdated
@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

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

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
@@          Coverage Diff           @@
##            main   #1182    +/-   ##
======================================
  Coverage   94.3%   94.3%            
======================================
  Files         61      61            
  Lines      14750   14860   +110     
======================================
+ Hits       13914   14024   +110     
  Misses       836     836            

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

joshka added 2 commits June 17, 2024 17:56
`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.

```rust
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 joshka force-pushed the jm/more-borders branch from b3353c3 to 67ac29d Compare June 18, 2024 00:58
@joshka joshka merged commit 1365620 into main Jun 18, 2024
@joshka joshka deleted the jm/more-borders branch June 18, 2024 00:59
itsjunetime pushed a commit to itsjunetime/ratatui that referenced this pull request Jun 23, 2024
`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.

```rust
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 added a commit to erak/ratatui that referenced this pull request Oct 14, 2024
`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.

```rust
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);
```
takumi-earth pushed a commit to earthlings-dev/ratatui that referenced this pull request Jan 27, 2026
`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.

```rust
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);
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants