Added extended selection capabilities to the API
This commit is contained in:
@@ -78,7 +78,7 @@ func (backend *Backend) NewWindow (
|
||||
func (window *Window) Adopt (child tomo.Element) {
|
||||
if window.child != nil {
|
||||
child.SetParentHooks (tomo.ParentHooks { })
|
||||
if child.Selectable() { child.Handle(tomo.EventDeselect { }) }
|
||||
if child.Selected() { child.Handle(tomo.EventDeselect { }) }
|
||||
}
|
||||
window.child = child
|
||||
if child != nil {
|
||||
@@ -87,12 +87,7 @@ func (window *Window) Adopt (child tomo.Element) {
|
||||
MinimumSizeChange: window.childMinimumSizeChangeCallback,
|
||||
SelectionRequest: window.childSelectionRequestCallback,
|
||||
})
|
||||
// TODO: it is possible for an element to start out as
|
||||
// selectable, and then become unselectable. it should be
|
||||
// standard behavior for containers (including windows) to, if
|
||||
// no children are selected, select the first child on ctrl-tab
|
||||
// press. we should therefore be able to ask any element if it
|
||||
// is selected.
|
||||
|
||||
if child.Selectable() { child.Handle(tomo.EventSelect { }) }
|
||||
window.resizeChildToFit()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user