Changed 'Tabbable/Focusable' logic to use Active

This commit is contained in:
2026-02-02 13:29:51 -06:00
parent 62ef3b5d44
commit 16a92c8f99
30 changed files with 377 additions and 322 deletions

View File

@@ -114,24 +114,27 @@ func (w *RelativeLayout) Draw(screen tcell.Screen) {
func (w *RelativeLayout) SetStyle(s tcell.Style) { w.style = s }
func (w *RelativeLayout) Active() bool { return w.active }
func (w *RelativeLayout) SetActive(a bool) { w.active = a }
func (w *RelativeLayout) Visible() bool { return w.visible }
func (w *RelativeLayout) SetVisible(a bool) { w.visible = a }
func (w *RelativeLayout) Focusable() bool { return w.focusable }
func (w *RelativeLayout) SetFocusable(b bool) { w.focusable = b }
func (w *RelativeLayout) SetX(x int) { w.x = x }
func (w *RelativeLayout) SetY(y int) { w.y = y }
func (w *RelativeLayout) GetX() int { return w.x }
func (w *RelativeLayout) GetY() int { return w.y }
func (w *RelativeLayout) SetSize(c Coord) { w.w, w.h = c.X, c.Y }
func (w *RelativeLayout) GetPos() Coord { return Coord{X: w.x, Y: w.y} }
func (w *RelativeLayout) SetPos(c Coord) { w.x, w.y = c.X, c.Y }
func (w *RelativeLayout) SetW(wd int) { w.w = wd }
func (w *RelativeLayout) SetH(h int) { w.h = h }
func (w *RelativeLayout) GetW() int { return w.w }
func (w *RelativeLayout) GetH() int { return w.h }
func (w *RelativeLayout) WantW() int { return 1 }
func (w *RelativeLayout) WantH() int { return 1 }
func (w *RelativeLayout) SetActive(a bool) bool {
w.active = a
return w.active
}
func (w *RelativeLayout) Visible() bool { return w.visible }
func (w *RelativeLayout) SetVisible(a bool) { w.visible = a }
func (w *RelativeLayout) Focusable() bool { return w.focusable }
func (w *RelativeLayout) SetFocusable(b bool) { w.focusable = b }
func (w *RelativeLayout) SetX(x int) { w.x = x }
func (w *RelativeLayout) SetY(y int) { w.y = y }
func (w *RelativeLayout) GetX() int { return w.x }
func (w *RelativeLayout) GetY() int { return w.y }
func (w *RelativeLayout) SetSize(c Coord) { w.w, w.h = c.X, c.Y }
func (w *RelativeLayout) GetPos() Coord { return Coord{X: w.x, Y: w.y} }
func (w *RelativeLayout) SetPos(c Coord) { w.x, w.y = c.X, c.Y }
func (w *RelativeLayout) SetW(wd int) { w.w = wd }
func (w *RelativeLayout) SetH(h int) { w.h = h }
func (w *RelativeLayout) GetW() int { return w.w }
func (w *RelativeLayout) GetH() int { return w.h }
func (w *RelativeLayout) WantW() int { return 1 }
func (w *RelativeLayout) WantH() int { return 1 }
func (w *RelativeLayout) MinW() int {
// Find the highest value for x in all widgets GetX() + MinW()
var minW int