gyscos / gyscos/cursive

Setting a style for a TextView

Open
#515 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
4.8k
Forks
270
Avg merge
5d 19h
Merged PRs (30d)
2

Description

This is a both a question and a feature request.

# Problem description

I saw the `TextView::set_effect` method and wanted to have a `set_style` method too. I was about to implement it when I saw your comment in `text_view.rs`:

```rust
// TODO: remove now that we have styled text?
effect: Effect,
```

So I wanted to discuss this here first.

Yes, the user can just set the content to a styled string instead of setting the effect or style for the text view. But for views that are created once and then updated regularly and from multiple code locations (e. g. a status bar), it is useful to have a way to set a default style for the view. So I think it would make sense to keep the `set_effect` method and to even add a `set_style(Into

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.