mirror of
https://github.com/rivo/tview.git
synced 2026-04-27 05:45:49 +03:00
[GH-ISSUE #611] Would be nice to expose tcell.Style directly #450
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/tview#450
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 @gdamore on GitHub (May 28, 2021).
Original GitHub issue: https://github.com/rivo/tview/issues/611
Many of the widgets here use tcell styles, but the tview API only exposes the Color explicitly. This leads to inconsistencies in some places. For example, the border can usually have attributes set on it, but other things can't. Some things can have their background color changed, and others can't.
I have a use case where I'd like to be able to provide underlining via attributes to things (basically I want to use List with colors and an underbar to make it look like sort of like hyperlinks).
It turns out that making Attributes available everywhere is also possibly very important, because in some settings we are not permitted to use color exclusively to convey meaning. (Due to color blindness). Using attributes would let us change the way the text is rendered to add underbars, reverse text (which can be simulated with colors), blink, italics, etc.
Essentially, I'd like every widget to have methods:
SetStyle(), SetBorderStyle(), SetTitleStyle(), etc.
@rivo commented on GitHub (May 29, 2021):
It's just a historical artifact that
tviewusesColormore thanStyle. I guess when I started the project, I thought colours would be all people needed. But I was obviously wrong.I can look into adding additional functions to set styles. But it has to be backwards compatible.
@golangdojo99 commented on GitHub (Sep 27, 2022):
+1
@rivo commented on GitHub (Dec 12, 2022):
I'm closing this as there's no need to track this issue anymore. I have added a lot of methods to set/get the
tcell.Styleobject directly already and continue to add them where they are still missing.