[GH-ISSUE #1133] Use reverse attributes on selected items instead of inverting foreground and background #821

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

Originally created by @ossenthusiast on GitHub (Nov 14, 2025).
Original GitHub issue: https://github.com/rivo/tview/issues/1133

Example:

func NewTreeNode(text string) *TreeNode {
	return &TreeNode{
// before
		selectedTextStyle: tcell.StyleDefault.Foreground(Styles.PrimitiveBackgroundColor).Background(Styles.PrimaryTextColor),
// after
		selectedTextStyle: tcell.StyleDefault.Reverse(true),
	}
}

This also applies to Form, List, etc.

Originally created by @ossenthusiast on GitHub (Nov 14, 2025). Original GitHub issue: https://github.com/rivo/tview/issues/1133 Example: ```go func NewTreeNode(text string) *TreeNode { return &TreeNode{ // before selectedTextStyle: tcell.StyleDefault.Foreground(Styles.PrimitiveBackgroundColor).Background(Styles.PrimaryTextColor), // after selectedTextStyle: tcell.StyleDefault.Reverse(true), } } ``` This also applies to Form, List, etc.
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#821
No description provided.