Closed Jaxx497 closed 1 week ago
This is the intended behavior.
https://docs.rs/ratatui/latest/ratatui/widgets/block/struct.Block.html#method.border_style
If a Block::style is defined, border_style will be applied on top of it.
https://docs.rs/ratatui/latest/ratatui/widgets/block/struct.Block.html#method.style
This is the most generic Style a block can receive, it will be merged with any other more specific style. Elements can be styled further with Block::title_style and Block::border_style.
https://github.com/ratatui-org/ratatui/blob/main/examples/README.md#block shows examples of various combinations of styling
To fix:
.border_style(Style::new().red().on_black().not_italic())
@Jaxx497 Would you mind taking a quick look at https://github.com/ratatui-org/ratatui/pull/1190 and see if that helps clarify your questions here, and perhaps suggest some better wording if it doesn't?
@joshka I think this is a great addition to the documentation. The example in particular is thought out and easy to follow. Admittedly, my initial misunderstanding came from not realizing that .style()
was overwriting the other styles (which now seems incredibly obvious). Thank you for taking the time to clarify this
Description
I've found that when displayed in the Windows terminal (via powershell), the borders of a widget will appear italicized.
To Reproduce
This is the relevant code that will reproduce the error (image below):
Expected behavior
I'd expect the borders to render normally (see code snippet at bottom for work-around)
Screenshots
Environment
Additional context
It's possible to workaround this issue with the following code. I didn't look too far into it, but it seems that the initial implementation is applying the italics to the border characters as well as the title characters, whereas the following implementation limits the italics to the title itself, but this feels far less intuitive to write out. It's worth noting that I did not see any problems with this when using Wezterm on Windows or Kitty on Arch Linux.