v0.1.0 initial commit

This commit is contained in:
2026-07-12 17:01:37 -04:00
commit c3ca2ebb63
64 changed files with 10453 additions and 0 deletions
+36
View File
@@ -0,0 +1,36 @@
package tui
import (
"github.com/lixenwraith/terminal"
)
// CheckState represents checkbox visual state
type CheckState uint8
const (
CheckNone CheckState = iota // [ ]
CheckPartial // [o]
CheckFull // [x]
CheckPlus // [+]
)
// Checkbox draws a checkbox indicator
func (r Region) Checkbox(x, y int, state CheckState, fg terminal.RGB) {
if x < 0 || x+2 >= r.W || y < 0 || y >= r.H {
return
}
var ch rune
switch state {
case CheckNone:
ch = ' '
case CheckPartial:
ch = 'o'
case CheckFull:
ch = 'x'
case CheckPlus:
ch = '+'
}
r.Cell(x, y, '[', fg, terminal.RGB{}, terminal.AttrNone)
r.Cell(x+1, y, ch, fg, terminal.RGB{}, terminal.AttrNone)
r.Cell(x+2, y, ']', fg, terminal.RGB{}, terminal.AttrNone)
}