rivo / tview

Terminal UI library with rich, interactive widgets — written in Golang
MIT License
11.13k stars 575 forks source link

No way to set color on individual list items #1046

Open SamWhited opened 1 month ago

SamWhited commented 1 month ago

The treeview provides a way to set the color on individual items in the tree, but the list view does not. It can still be done by using style tags in the text itself, but when this is done the various styles on list view (ie. setting the highlighted style) no longer work which is confusing and also means that if the list text has meaning you have to strip style tags out of it first before you can use it.

It would be nice to have a way to add a list item with specific styles set, or have a way to get the text of list items without styles tags included and have any styles set on the list override those style tags.

In my particular case I have a file opener UI which can swap between a tree view of the filesystem or a list view, but it's proving hard to ensure the styles remain consistent (and if I get the filename from the list it has style tags in it that have to be split out).