make-containers-better #10
@ -330,16 +330,12 @@ func (propagator *Propagator) forFlexible (callback func (child elements.Flexibl
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
func (propagator *Propagator) firstFocused () (index int) {
|
func (propagator *Propagator) firstFocused () int {
|
||||||
index = -1
|
for index := 0; index < propagator.parent.CountChildren(); index ++ {
|
||||||
currentIndex := 0
|
child, focusable := propagator.parent.Child(index).(elements.Focusable)
|
||||||
propagator.forFocusable (func (child elements.Focusable) bool {
|
if focusable && child.Focused() {
|
||||||
if child.Focused() {
|
return index
|
||||||
index = currentIndex
|
|
||||||
return false
|
|
||||||
}
|
}
|
||||||
currentIndex ++
|
}
|
||||||
return true
|
return -1
|
||||||
})
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user