Fix TopMenu

Add Shrinkwrap
This commit is contained in:
2025-08-14 08:29:58 -05:00
parent 0c6f212e18
commit 566f35e655
5 changed files with 109 additions and 35 deletions

View File

@@ -86,8 +86,8 @@ func (w *TopMenuLayout) HandleKey(ev *tcell.EventKey) bool {
w.menu.SetActive(!w.menu.Active())
return true
}
if w.menu.HandleKey(ev) {
return true
if w.menu.Active() {
return w.menu.HandleKey(ev)
}
// Pass the key through to the main widget
@@ -114,8 +114,11 @@ func (w *TopMenuLayout) Draw(screen tcell.Screen) {
}
}
func (w *TopMenuLayout) Active() bool { return w.active }
func (w *TopMenuLayout) SetActive(a bool) { w.active = a }
func (w *TopMenuLayout) Active() bool { return w.active }
func (w *TopMenuLayout) SetActive(a bool) {
w.active = a
w.widget.SetActive(a)
}
func (w *TopMenuLayout) Visible() bool { return w.visible }
func (w *TopMenuLayout) SetVisible(a bool) { w.visible = a }
func (w *TopMenuLayout) SetX(x int) { w.x = x }