Update List, Table and TreeView to not handle Tab or Backtab

This commit is contained in:
Trevor Slocum 2021-05-25 09:04:35 -07:00
parent 3581fe03ea
commit 919f229dcc
4 changed files with 8 additions and 7 deletions

View File

@ -1,5 +1,6 @@
v1.5.6 (WIP)
- Draw additional accents when rendering a list divider
- Update List, Table and TreeView to not handle Tab or Backtab
v1.5.5 (2020-05-24)
- Fix Application.Suspend by restructuring event loop (queued updates will now only run between draws)

View File

@ -927,8 +927,8 @@ func (l *List) Draw(screen tcell.Screen) {
}
if len(item.mainText) == 0 && len(item.secondaryText) == 0 && item.shortcut == 0 { // Divider
Print(screen, bytes.Repeat([]byte(string(tcell.RuneHLine)), fullWidth), leftEdge-1, y, fullWidth, AlignLeft, l.mainTextColor)
Print(screen, []byte(string(tcell.RuneLTee)), leftEdge-2, y, 1, AlignLeft, l.mainTextColor)
Print(screen, bytes.Repeat([]byte(string(tcell.RuneHLine)), fullWidth), leftEdge-1, y, fullWidth, AlignLeft, l.mainTextColor)
Print(screen, []byte(string(tcell.RuneRTee)), leftEdge+fullWidth-1, y, 1, AlignLeft, l.mainTextColor)
RenderScrollBar(screen, l.scrollBarVisibility, scrollBarX, y, scrollBarHeight, len(l.items), scrollBarCursor, index-l.itemOffset, l.hasFocus, l.scrollBarColor)
@ -1145,9 +1145,9 @@ func (l *List) InputHandler() func(event *tcell.EventKey, setFocus func(p Primit
l.transform(TransformFirstItem)
} else if HitShortcut(event, Keys.MoveLast, Keys.MoveLast2) {
l.transform(TransformLastItem)
} else if HitShortcut(event, Keys.MoveUp, Keys.MoveUp2, Keys.MovePreviousField) {
} else if HitShortcut(event, Keys.MoveUp, Keys.MoveUp2) {
l.transform(TransformPreviousItem)
} else if HitShortcut(event, Keys.MoveDown, Keys.MoveDown2, Keys.MoveNextField) {
} else if HitShortcut(event, Keys.MoveDown, Keys.MoveDown2) {
l.transform(TransformNextItem)
} else if HitShortcut(event, Keys.MoveLeft, Keys.MoveLeft2) {
l.columnOffset--

View File

@ -1388,9 +1388,9 @@ func (t *Table) InputHandler() func(event *tcell.EventKey, setFocus func(p Primi
home()
} else if HitShortcut(event, Keys.MoveLast, Keys.MoveLast2) {
end()
} else if HitShortcut(event, Keys.MoveUp, Keys.MoveUp2, Keys.MovePreviousField) {
} else if HitShortcut(event, Keys.MoveUp, Keys.MoveUp2) {
up()
} else if HitShortcut(event, Keys.MoveDown, Keys.MoveDown2, Keys.MoveNextField) {
} else if HitShortcut(event, Keys.MoveDown, Keys.MoveDown2) {
down()
} else if HitShortcut(event, Keys.MoveLeft, Keys.MoveLeft2) {
left()

View File

@ -905,9 +905,9 @@ func (t *TreeView) InputHandler() func(event *tcell.EventKey, setFocus func(p Pr
t.movement = treeHome
} else if HitShortcut(event, Keys.MoveLast, Keys.MoveLast2) {
t.movement = treeEnd
} else if HitShortcut(event, Keys.MoveUp, Keys.MoveUp2, Keys.MovePreviousField) {
} else if HitShortcut(event, Keys.MoveUp, Keys.MoveUp2) {
t.movement = treeUp
} else if HitShortcut(event, Keys.MoveDown, Keys.MoveDown2, Keys.MoveNextField) {
} else if HitShortcut(event, Keys.MoveDown, Keys.MoveDown2) {
t.movement = treeDown
} else if HitShortcut(event, Keys.MovePreviousPage) {
t.movement = treePageUp