Browse Source

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

master
Trevor Slocum 3 weeks ago
parent
commit
919f229dcc
4 changed files with 8 additions and 7 deletions
  1. +1
    -0
      CHANGELOG
  2. +3
    -3
      list.go
  3. +2
    -2
      table.go
  4. +2
    -2
      treeview.go

+ 1
- 0
CHANGELOG 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)


+ 3
- 3
list.go 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--


+ 2
- 2
table.go 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()


+ 2
- 2
treeview.go 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


Loading…
Cancel
Save