v0.26.1
0.26.1 - 2024-02-12
This is a patch release that fixes bugs and adds enhancements, including new iterators, title options for blocks, and various rendering improvements. β¨
Features
-
74a0511
(rect) Add Rect::positions iterator (#928)Useful for performing some action on all the cells in a particular area. E.g., ```rust fn render(area: Rect, buf: &mut Buffer) { for position in area.positions() { buf.get_mut(position.x, position.y).set_symbol("x"); } } ```
-
9182f47
(uncategorized) Add Block::title_top and Block::title_top_bottom (#940)This adds the ability to add titles to the top and bottom of a block without having to use the `Title` struct (which will be removed in a future release - likely v0.28.0). Fixes a subtle bug if the title was created from a right aligned Line and was also right aligned. The title would be rendered one cell too far to the right. ```rust Block::bordered() .title_top(Line::raw("A").left_aligned()) .title_top(Line::raw("B").centered()) .title_top(Line::raw("C").right_aligned()) .title_bottom(Line::raw("D").left_aligned()) .title_bottom(Line::raw("E").centered()) .title_bottom(Line::raw("F").right_aligned()) .render(buffer.area, &mut buffer); // renders "βAβββββBβββββCβ", "β β", "βDβββββEβββββFβ", ``` Addresses part of https://github.com/ratatui-org/ratatui/issues/738
Bug Fixes
-
2202059
(block) Fix crash on empty right aligned title (#933)- Simplified implementation of the rendering for block. - Introduces a subtle rendering change where centered titles that are odd in length will now be rendered one character to the left compared to before. This aligns with other places that we render centered text and is a more consistent behavior. See https://github.com/ratatui-org/ratatui/pull/807#discussion_r1455645954 for another example of this.
Fixes: #929
-
14c67fb
(list) Highlight symbol when using a multi-bytes char (#924)ratatui v0.26.0 brought a regression in the List widget, in which the highlight symbol width was incorrectly calculated - specifically when the highlight symbol was a multi-char character, e.g. `βΆ`.
-
0dcdbea
(paragraph) Render Line::styled correctly inside a paragraph (#930)Renders the styled graphemes of the line instead of the contained spans.
-
fae5862
(uncategorized) Ensure that buffer::set_line sets the line style (#926)Fixes a regression in 0.26 where buffer::set_line was no longer setting the style. This was due to the new style field on Line instead of being stored only in the spans. Also adds a configuration for just running unit tests to bacon.toml.
-
fbb5dfa
(uncategorized) Scrollbar rendering when no track symbols are provided (#911)
Refactor
Documentation
-
61a8278
(canvas) Add documentation to canvas module (#913)Document the whole `canvas` module. With this, the whole `widgets` module is documented.
Performance
Miscellaneous Tasks
-
18870ce
(uncategorized) Fix the method name for setting the Line style (#947) -
8fb4630
(uncategorized) Remove github action bot that makes comments nudging commit signing (#937)We can consider reverting this commit once this PR is merged: https://github.com/1Password/check-signed-commits-action/pull/9
Contributors
Thank you so much to everyone that contributed to this release!
Here is the list of contributors who have contributed to ratatui
for the first time!