Skip to content
This repository has been archived by the owner on Aug 6, 2023. It is now read-only.

List can't have two Text::Styled in one row #118

Closed
kpcyrd opened this issue Jan 22, 2019 · 1 comment · Fixed by #316
Closed

List can't have two Text::Styled in one row #118

kpcyrd opened this issue Jan 22, 2019 · 1 comment · Fixed by #316

Comments

@kpcyrd
Copy link

kpcyrd commented Jan 22, 2019

It seems tui::widgets::List expects a list/iterator of Text, but Text can only be Text::Raw or Text::Styled. It seems I can work around this by using terminal escape characters directly, but it might be a good idea to allow eg 2 Text::Styled.

@fdehau
Copy link
Owner

fdehau commented Jan 23, 2019

This is something I'm experimenting with in #102 but this has a larger implication on the crate itself. The problem is to provide a common interface for people to define their stylized text. For example, there also no way to set the title of a block with the first letter as red and the rest blue. The current principle of the crate is to allow users to customize style of whole widgets "blocks", e.g change the color of this item, change the color of this border, etc. In order to be more flexible, those methods would disappear in favor of a stylized text interface that would be "consumed" by the widgets.

There is also some layout implication as highlighted by @karolinepauls in #89. This has the potential to make this crate way more flexible but it is also a big change that I'm afraid I don't have a lot of time to work on currently.

TLDR: yes this is a known problem and yes using raw escapes characters is unlikely to get you the result you want :/

@fdehau fdehau mentioned this issue Jul 5, 2020
8 tasks
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants