mirror of
https://github.com/rivo/tview.git
synced 2026-04-26 13:25:51 +03:00
[GH-ISSUE #630] improve text readability for selected TreeNodes #462
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/tview#462
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @SoMuchForSubtlety on GitHub (Jul 31, 2021).
Original GitHub issue: https://github.com/rivo/tview/issues/630
Since the introduction of supporting transparency (#558), text colour of selected TreeView nodes has been problematic. I propose that instead of setting the foreground colour to white, we set it to the node colour offset plus a brightness offset (darker or brighter).
I included this functionality in my original fix to enable transparency
github.com/SoMuchForSubtlety/tview@88987c7f50@rivo commented on GitHub (Aug 22, 2021):
Why does the text of the selected nodes in your "current behaviour" example remain white? The code simply inverts the colours of selected nodes:
github.com/rivo/tview@29d673af0c/treeview.go (L714-L718)I would therefore expect the red items to be black on red and the white items to be black on white. (That's what it looks like in the
TreeViewdemo, too.)What have you set as the colours that makes it look like in your screenshot?
@SoMuchForSubtlety commented on GitHub (Aug 24, 2021):
tview.Styles.PrimitiveBackgroundColoris set totcell.ColorDefault.If I do the same for the TreeView example (and make files selectable) this is the result

@rivo commented on GitHub (Feb 15, 2022):
It's not advisable to use
tcell.ColorDefault. Check out https://github.com/rivo/tview/wiki/FAQ for details.