mirror of https://github.com/rivo/tview.git
SetOffset() also turns off end-tracking in Table. Fixes #238
This commit is contained in:
parent
c16128c927
commit
03d744dee3
4
list.go
4
list.go
|
@ -424,9 +424,7 @@ func (l *List) Draw(screen tcell.Screen) {
|
||||||
|
|
||||||
// Background color of selected text.
|
// Background color of selected text.
|
||||||
if index == l.currentItem && (!l.selectedFocusOnly || l.HasFocus()) {
|
if index == l.currentItem && (!l.selectedFocusOnly || l.HasFocus()) {
|
||||||
|
textWidth := width
|
||||||
// Width of background color of selected item.
|
|
||||||
var textWidth int = width
|
|
||||||
if !l.highlightFullLine {
|
if !l.highlightFullLine {
|
||||||
if w := StringWidth(item.MainText); w < textWidth {
|
if w := StringWidth(item.MainText); w < textWidth {
|
||||||
textWidth = w
|
textWidth = w
|
||||||
|
|
1
table.go
1
table.go
|
@ -368,6 +368,7 @@ func (t *Table) Select(row, column int) *Table {
|
||||||
// Fixed rows and columns are never skipped.
|
// Fixed rows and columns are never skipped.
|
||||||
func (t *Table) SetOffset(row, column int) *Table {
|
func (t *Table) SetOffset(row, column int) *Table {
|
||||||
t.rowOffset, t.columnOffset = row, column
|
t.rowOffset, t.columnOffset = row, column
|
||||||
|
t.trackEnd = false
|
||||||
return t
|
return t
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue