-
Notifications
You must be signed in to change notification settings - Fork 258
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
Block title_style is not rendered #349
Labels
Comments
Valentin271
added a commit
to Valentin271/ratatui
that referenced
this issue
Aug 3, 2023
Valentin271
added a commit
to Valentin271/ratatui
that referenced
this issue
Aug 3, 2023
Valentin271
added a commit
to Valentin271/ratatui
that referenced
this issue
Aug 3, 2023
Valentin271
added a commit
to Valentin271/ratatui
that referenced
this issue
Aug 3, 2023
Valentin271
added a commit
to Valentin271/ratatui
that referenced
this issue
Aug 4, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
In the recent PR to support multiple titles, we accidentally made title_style no longer effective. It's useful to have this as a fallback style as it makes it easy to apply a style to all titles except one:
e.g.
To Reproduce
Expected behavior
The Block's title style should be applied to the title.
The order which styles should effect the title (later styles should override earlier):
Block.style
Block.border_style
Block.title_style
- this is the missing pieceTitle.content.style
(Line.style
): Out of scope for this issue asLine
currently doesn't have a style, but shouldTitle.content.spans
->Span.style
Screenshots
Environment
Additional context
This is the code that needs to be modified for this:
ratatui/src/widgets/block.rs
Lines 418 to 423 in bf49446
ratatui/src/widgets/block.rs
Lines 444 to 449 in bf49446
ratatui/src/widgets/block.rs
Lines 465 to 470 in bf49446
There's a simple ways to approach this (just create a new line from the old line with the appropriate title_style applied before the line's style).
There's also a more complex fix for this that changes the way line style is stored / rendered so that line style overrides can be consistently handled by any widget. If you decide to implement the complex approach, please implement the simple approach first so there is tests for the intended behavior, and discuss the API changes for this prior to implementation as this likely requires changes to the public api of ratatui.
The text was updated successfully, but these errors were encountered: