mirror of https://github.com/rivo/tview.git
Added own implementation of SetBackgroundColor() to TextView, to keep backwards compatibility. Fixes #777
This commit is contained in:
parent
e6cd7110ac
commit
55d1ca9d33
Binary file not shown.
Before Width: | Height: | Size: 52 KiB After Width: | Height: | Size: 57 KiB |
|
@ -376,6 +376,15 @@ func (t *TextView) SetTextColor(color tcell.Color) *TextView {
|
|||
return t
|
||||
}
|
||||
|
||||
// SetBackgroundColor overrides its implementation in Box to set the background
|
||||
// color of this primitive. For backwards compatibility reasons, it also sets
|
||||
// the background color of the main text element.
|
||||
func (t *TextView) SetBackgroundColor(color tcell.Color) *Box {
|
||||
t.Box.SetBackgroundColor(color)
|
||||
t.textStyle = t.textStyle.Background(color)
|
||||
return t.Box
|
||||
}
|
||||
|
||||
// SetTextStyle sets the initial style of the text (which can be changed
|
||||
// dynamically by sending color strings in square brackets to the text view if
|
||||
// dynamic colors are enabled). This style's background color also determines
|
||||
|
|
Loading…
Reference in New Issue