Labels may request an expanding height change

This commit is contained in:
2023-01-16 18:04:41 -05:00
parent 7754679710
commit d9281b139f
7 changed files with 71 additions and 18 deletions

View File

@@ -15,6 +15,10 @@ type ParentHooks struct {
// have already been resized and there is no need to send it a resize
// event.
MinimumSizeChange func (width, height int)
// ExpandingHeightChange is called when the parameters affecting the
// element's expanding height have changed.
ExpandingHeightChange func ()
// SelectionRequest is called when the child element element wants
// itself to be selected. If the parent element chooses to grant the
@@ -42,6 +46,14 @@ func (hooks ParentHooks) RunMinimumSizeChange (width, height int) {
}
}
// RunExpandingHeightChange runs the ExpandingHeightChange hook if it is not
// nil. If it is nil, it does nothing.
func (hooks ParentHooks) RunExpandingHeightChange () {
if hooks.ExpandingHeightChange != nil {
hooks.ExpandingHeightChange()
}
}
// RunSelectionRequest runs the SelectionRequest hook if it is not nil. If it is
// nil, it does nothing.
func (hooks ParentHooks) RunSelectionRequest () (granted bool) {