rivo / tview

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

Undesirable List Behavior #954

Closed Souheab closed 2 months ago

Souheab commented 3 months ago

For the following code:

    list := tview.NewList().
        AddItem("hello", "", 0, nil ).
        AddItem("World","" , 0, nil ).
        AddItem("!","" , 0, nil ).
        AddItem("qwertyiopasdfghjkl;","" , 0, nil ).
        ShowSecondaryText(false).
        SetHighlightFullLine(true).
        SetSelectedStyle(tcell.StyleDefault.Reverse(true).Foreground(tcell.ColorBlue))

The rendered list looks like this:

image

It seems that the selected style with the reversed attribute set to true is only being applied to the mainText portion of the list, I would like the given style to be applied to the full line instead of just the mainText

rivo commented 2 months ago

Thanks for reporting this. The latest commit should fix this issue.

See also https://github.com/rivo/tview/pull/960#issuecomment-2034676479