mirror of https://github.com/mum4k/termdash.git
Merge branch 'devel' into 243-form-demo
This commit is contained in:
commit
bb95f538ca
|
@ -123,7 +123,8 @@ func (c *Container) hasWidget() bool {
|
|||
}
|
||||
|
||||
// isLeaf determines if this container is a leaf container in the binary tree of containers.
|
||||
// Only leaf containers are guaranteed to be "visible" on the screen.
|
||||
// Only leaf containers are guaranteed to be "visible" on the screen, because
|
||||
// they are on the top of other non-leaf containers.
|
||||
func (c *Container) isLeaf() bool {
|
||||
return c.first == nil && c.second == nil
|
||||
}
|
||||
|
@ -331,7 +332,7 @@ func (c *Container) prepareEvTargets(ev terminalapi.Event) (func() error, error)
|
|||
|
||||
// Update the focused container based on the pressed key.
|
||||
// Done after collecting "targets" above. If the key changes which
|
||||
// widget is focused, they key press itself should go to the widget
|
||||
// container is focused, they key press itself should go to the widget
|
||||
// that was focused when the key was pressed.
|
||||
c.updateFocusFromKeyboard(ev.(*terminalapi.Keyboard))
|
||||
return func() error {
|
||||
|
|
|
@ -1548,7 +1548,6 @@ func TestMouse(t *testing.T) {
|
|||
testcanvas.MustNew(image.Rect(25, 0, 50, 20)),
|
||||
&widgetapi.Meta{},
|
||||
widgetapi.Options{WantKeyboard: widgetapi.KeyScopeFocused},
|
||||
&terminalapi.Keyboard{},
|
||||
)
|
||||
return ft
|
||||
},
|
||||
|
@ -1592,7 +1591,6 @@ func TestMouse(t *testing.T) {
|
|||
testcanvas.MustNew(image.Rect(25, 0, 50, 20)),
|
||||
&widgetapi.Meta{Focused: true},
|
||||
widgetapi.Options{WantKeyboard: widgetapi.KeyScopeFocused},
|
||||
&terminalapi.Keyboard{},
|
||||
)
|
||||
return ft
|
||||
},
|
||||
|
|
|
@ -114,9 +114,8 @@ func (ft *focusTracker) next() {
|
|||
if nextCont == nil && firstCont != nil {
|
||||
// If the traversal finishes without finding the next container, move
|
||||
// focus back to the first container.
|
||||
nextCont = firstCont
|
||||
}
|
||||
if nextCont != nil {
|
||||
ft.setActive(firstCont)
|
||||
} else if nextCont != nil {
|
||||
ft.setActive(nextCont)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue