ratatui/src
Dheepak Krishnamurthy 12f67e810f
feat: impl Widget for &str and String (#952)
Currently, `f.render_widget("hello world".bold(), area)` works but
`f.render_widget("hello world", area)` doesn't. This PR changes that my
implementing `Widget` for `&str` and `String`. This makes it easier to
render strings with no styles as widgets.

Example usage:

```rust
terminal.draw(|f| f.render_widget("Hello World!", f.size()))?;
```

---------

Co-authored-by: Josh McKinney <joshka@users.noreply.github.com>
2024-02-14 06:26:08 -05:00
..
backend docs(examples): document incompatible examples better (#844) 2024-01-18 01:56:06 -08:00
buffer fix: ensure that buffer::set_line sets the line style (#926) 2024-02-05 16:26:23 -08:00
layout feat(layout): mark various functions as const (#951) 2024-02-13 19:05:23 -08:00
style feat: Add Color::from_hsl (#772) 2024-01-24 04:42:39 -08:00
terminal feat: add WidgetRef and StatefulWidgetRef traits (#903) 2024-02-02 00:02:16 -08:00
text feat: add WidgetRef and StatefulWidgetRef traits (#903) 2024-02-02 00:02:16 -08:00
widgets feat(layout): mark various functions as const (#951) 2024-02-13 19:05:23 -08:00
backend.rs docs(examples): document incompatible examples better (#844) 2024-01-18 01:56:06 -08:00
buffer.rs feat: accept Color and Modifier for all Styles (#720) 2023-12-31 10:01:06 -08:00
layout.rs feat(layout): mark various functions as const (#951) 2024-02-13 19:05:23 -08:00
lib.rs docs: add link to FOSDEM 2024 talk (#944) 2024-02-12 10:54:05 +01:00
prelude.rs feat: add WidgetRef and StatefulWidgetRef traits (#903) 2024-02-02 00:02:16 -08:00
style.rs feat(style): add tailwind color palette (#787) 2024-01-11 10:07:53 -08:00
symbols.rs feat: add wide and tall proportional border set (#848) 2024-01-19 00:24:49 -08:00
terminal.rs refactor(terminal): extract types to files (#760) 2024-01-07 12:53:16 +01:00
text.rs feat(line): implement Widget for Line (#715) 2023-12-27 20:30:47 +01:00
widgets.rs feat: impl Widget for &str and String (#952) 2024-02-14 06:26:08 -05:00