Updated README screencast. Also fixed Table rendering issue.

This commit is contained in:
Oliver 2022-11-28 17:58:37 +01:00
parent 1480dc5b05
commit db36428c92
3 changed files with 4 additions and 2 deletions

View File

@ -21,6 +21,7 @@ const form = `[green]package[white] main
}, [red]0[white], nil). }, [red]0[white], nil).
[yellow]AddCheckbox[white]([red]"On vacation:"[white], false, nil). [yellow]AddCheckbox[white]([red]"On vacation:"[white], false, nil).
[yellow]AddPasswordField[white]([red]"Password:"[white], [red]""[white], [red]10[white], [red]'*'[white], nil). [yellow]AddPasswordField[white]([red]"Password:"[white], [red]""[white], [red]10[white], [red]'*'[white], nil).
[yellow]AddTextArea[white]([red]"Notes:"[white], [red]""[white], [red]0[white], [red]5[white], [red]0[white], nil).
[yellow]AddButton[white]([red]"Save"[white], [yellow]func[white]() { [blue]/* Save data */[white] }). [yellow]AddButton[white]([red]"Save"[white], [yellow]func[white]() { [blue]/* Save data */[white] }).
[yellow]AddButton[white]([red]"Cancel"[white], [yellow]func[white]() { [blue]/* Cancel */[white] }) [yellow]AddButton[white]([red]"Cancel"[white], [yellow]func[white]() { [blue]/* Cancel */[white] })
tview.[yellow]NewApplication[white](). tview.[yellow]NewApplication[white]().
@ -36,8 +37,9 @@ func Form(nextSlide func()) (title string, content tview.Primitive) {
AddDropDown("Role:", []string{"Engineer", "Manager", "Administration"}, 0, nil). AddDropDown("Role:", []string{"Engineer", "Manager", "Administration"}, 0, nil).
AddCheckbox("On vacation:", false, nil). AddCheckbox("On vacation:", false, nil).
AddPasswordField("Password:", "", 10, '*', nil). AddPasswordField("Password:", "", 10, '*', nil).
AddTextArea("Notes:", "", 0, 5, 0, nil).
AddButton("Save", nextSlide). AddButton("Save", nextSlide).
AddButton("Cancel", nextSlide) AddButton("Cancel", nextSlide)
f.SetBorder(true).SetTitle("Employee Information") f.SetBorder(true).SetTitle("Employee Information")
return "Forms", Code(f, 36, 15, form) return "Forms", Code(f, 36, 21, form)
} }

View File

@ -1137,7 +1137,7 @@ func (t *Table) Draw(screen tcell.Screen) {
break // No space for the text anymore. break // No space for the text anymore.
} }
drawBorder(columnX-1, rowY, Borders.Vertical) drawBorder(columnX-1, rowY, Borders.Vertical)
} else if column < columnCount-1 { } else if columnIndex < len(columns)-1 {
// Draw separator. // Draw separator.
drawBorder(columnX+columnWidth, rowY, t.separator) drawBorder(columnX+columnWidth, rowY, t.separator)
} }

BIN
tview.gif

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 MiB

After

Width:  |  Height:  |  Size: 991 KiB