gdamore/tcell

Upperline (together with Underline)

vlappa opened this issue · 2 comments

There is a Underline attribute, but not a Upperline.

To select a item in a scrollable list, one typically uses the attribute Reverse. But if you use icons instead of text, it covers up the icons and make the colors of those invisible.

To fix this, one could use Underline, but actually both Underline and Upperline to make a selected item visible, might be what I'm looking for.

Ok, but then the ends are open, hm... maybe I could do something with views, but it will add complexity...

Reverse, or change the background color, is what you probably want. If your icons are so large that there is no background showing through, then that's a different problem, and you'll want to use some other approach (such as an arrow indicator on the side.). (There should be enough background showing through for upperline to work anyway.)

Coloring underline is not generally possible, although some terminals might have some escape sequences for it. But normally it is just the foreground color.

As far as Upperline goes -- I didn't even know that was a thing. It might be something I could add later if desired. But I suspect very few terminals have support for it, so it's tricky to depend on that in an application unless you know you only have to support certain terminals or emulators.

Upperline is nothing technical, just a naive idea. ;)

I think the solution is not using reverse, but probably something with the background color indeed. Thanks for thinking with me.