[GH-ISSUE #1046] No way to set color on individual list items #759

Open
opened 2026-03-04 01:07:32 +03:00 by kerem · 0 comments
Owner

Originally created by @SamWhited on GitHub (Oct 25, 2024).
Original GitHub issue: https://github.com/rivo/tview/issues/1046

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).

Originally created by @SamWhited on GitHub (Oct 25, 2024). Original GitHub issue: https://github.com/rivo/tview/issues/1046 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).
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/tview#759
No description provided.