Fix TopMenu
Add Shrinkwrap
This commit is contained in:
@@ -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 }
|
||||
|
||||
Reference in New Issue
Block a user