From c152a5230492f7dbcae493b15b91cfefdaad307d Mon Sep 17 00:00:00 2001 From: Brian Buller Date: Thu, 17 Jul 2025 11:27:58 -0500 Subject: [PATCH] Fix Menu Want Width --- menu.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/menu.go b/menu.go index 8ce6cbd..90ae7e4 100644 --- a/menu.go +++ b/menu.go @@ -108,7 +108,7 @@ func (w *Menu) drawHMenu(screen tcell.Screen) { x, y := w.x, w.y if len(w.label) > 0 { h.DrawText(x, y, w.label, st, screen) - x = x + len(w.label) + 1 + x = x + len(w.label) + 2 } x += 2 if w.expanded || (w.active && !w.manualExpand) { @@ -116,7 +116,7 @@ func (w *Menu) drawHMenu(screen tcell.Screen) { w.items[i].SetActive(w.active && w.cursor == i) w.items[i].SetPos(Coord{X: x, Y: y}) w.items[i].Draw(screen) - x += w.items[i].WantW() + 1 + x += w.items[i].WantW() + 2 } } } @@ -168,6 +168,9 @@ func (w *Menu) WantW() int { maxW = w.items[i].WantW() } } + if maxW < len(w.label) { + maxW = len(w.label) + } return maxW }