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

@@ -119,27 +119,28 @@ func (w *Button) Draw(screen tcell.Screen) {
wh.DrawText(w.x, w.y+2, fmt.Sprintf("╰%s╯", strings.Repeat("─", w.w-2)), dStyle, screen)
}
func (w *Button) Active() bool { return w.active }
func (w *Button) SetActive(a bool) { w.active = a }
func (w *Button) Visible() bool { return w.visible }
func (w *Button) SetVisible(a bool) { w.visible = a }
func (w *Button) SetX(x int) { w.x = x }
func (w *Button) SetY(y int) { w.y = y }
func (w *Button) GetX() int { return w.x }
func (w *Button) GetY() int { return w.y }
func (w *Button) GetPos() Coord { return Coord{X: w.x, Y: w.y} }
func (w *Button) SetPos(c Coord) { w.x, w.y = c.X, c.Y }
func (w *Button) SetW(x int) { w.w = x }
func (w *Button) SetH(y int) { w.h = y }
func (w *Button) GetW() int { return w.w }
func (w *Button) GetH() int { return w.h }
func (w *Button) WantW() int { return 4 + len(w.label) }
func (w *Button) WantH() int { return 3 }
func (w *Button) SetSize(c Coord) { w.w, w.h = c.X, c.Y }
func (w *Button) Focusable() bool { return w.focusable }
func (w *Button) SetFocusable(b bool) { w.focusable = b }
func (w *Button) MinW() int { return len(w.label) + 2 }
func (w *Button) MinH() int { return 1 }
func (w *Button) SetStyle(s tcell.Style) { w.style = s }
func (w *Button) Active() bool { return w.active }
func (w *Button) SetActive(a bool) { w.active = a }
func (w *Button) Visible() bool { return w.visible }
func (w *Button) SetVisible(a bool) { w.visible = a }
func (w *Button) SetX(x int) { w.x = x }
func (w *Button) SetY(y int) { w.y = y }
func (w *Button) GetX() int { return w.x }
func (w *Button) GetY() int { return w.y }
func (w *Button) GetPos() Coord { return Coord{X: w.x, Y: w.y} }
func (w *Button) SetPos(c Coord) { w.x, w.y = c.X, c.Y }
func (w *Button) SetW(x int) { w.w = x }
func (w *Button) SetH(y int) { w.h = y }
func (w *Button) GetW() int { return w.w }
func (w *Button) GetH() int { return w.h }
func (w *Button) WantW() int { return 4 + len(w.label) }
func (w *Button) WantH() int { return 3 }
func (w *Button) SetSize(c Coord) { w.w, w.h = c.X, c.Y }
func (w *Button) Focusable() bool { return w.focusable }
func (w *Button) SetFocusable(b bool) { w.focusable = b }
func (w *Button) MinW() int { return len(w.label) + 2 }
func (w *Button) MinH() int { return 1 }
func (w *Button) SetLabel(l string) { w.label = l }
func (w *Button) SetOnPressed(p func() bool) { w.onPressed = p }