Add SetStyle Function

This commit is contained in:
2026-01-23 09:36:43 -06:00
parent d442b7d6a8
commit c1296b1dc1
31 changed files with 425 additions and 392 deletions

View File

@@ -92,20 +92,21 @@ func (w *Checkbox) Draw(screen tcell.Screen) {
wh.DrawText(w.x, w.y, fmt.Sprintf("[%s] %s", string(w.stateRunes[w.state]), w.label), dStyle, screen)
}
func (w *Checkbox) Active() bool { return w.active }
func (w *Checkbox) SetActive(a bool) { w.active = a }
func (w *Checkbox) Visible() bool { return w.visible }
func (w *Checkbox) SetVisible(a bool) { w.visible = a }
func (w *Checkbox) SetX(x int) { w.x = x }
func (w *Checkbox) SetY(y int) { w.y = y }
func (w *Checkbox) GetX() int { return w.x }
func (w *Checkbox) GetY() int { return w.y }
func (w *Checkbox) GetPos() Coord { return Coord{X: w.x, Y: w.y} }
func (w *Checkbox) SetPos(c Coord) { w.x, w.y = c.X, c.Y }
func (w *Checkbox) SetW(x int) { w.w = x }
func (w *Checkbox) SetH(y int) { w.h = y }
func (w *Checkbox) GetW() int { return w.w }
func (w *Checkbox) GetH() int { return w.y }
func (w *Checkbox) SetStyle(s tcell.Style) { w.style = s }
func (w *Checkbox) Active() bool { return w.active }
func (w *Checkbox) SetActive(a bool) { w.active = a }
func (w *Checkbox) Visible() bool { return w.visible }
func (w *Checkbox) SetVisible(a bool) { w.visible = a }
func (w *Checkbox) SetX(x int) { w.x = x }
func (w *Checkbox) SetY(y int) { w.y = y }
func (w *Checkbox) GetX() int { return w.x }
func (w *Checkbox) GetY() int { return w.y }
func (w *Checkbox) GetPos() Coord { return Coord{X: w.x, Y: w.y} }
func (w *Checkbox) SetPos(c Coord) { w.x, w.y = c.X, c.Y }
func (w *Checkbox) SetW(x int) { w.w = x }
func (w *Checkbox) SetH(y int) { w.h = y }
func (w *Checkbox) GetW() int { return w.w }
func (w *Checkbox) GetH() int { return w.y }
func (w *Checkbox) WantW() int {
return len(fmt.Sprintf("[%s] %s", string(w.state), w.label))
}