Half-working container flexibility propagation

This commit is contained in:
2023-01-16 23:34:17 -05:00
parent 76d50bb01a
commit e94e170a04
8 changed files with 91 additions and 34 deletions

View File

@@ -16,9 +16,9 @@ type ParentHooks struct {
// event.
MinimumSizeChange func (width, height int)
// ExpandingHeightChange is called when the parameters affecting the
// FlexibleHeightChange is called when the parameters affecting the
// element's expanding height have changed.
ExpandingHeightChange func ()
FlexibleHeightChange func ()
// SelectionRequest is called when the child element element wants
// itself to be selected. If the parent element chooses to grant the
@@ -46,11 +46,11 @@ func (hooks ParentHooks) RunMinimumSizeChange (width, height int) {
}
}
// RunExpandingHeightChange runs the ExpandingHeightChange hook if it is not
// RunFlexibleHeightChange 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()
func (hooks ParentHooks) RunFlexibleHeightChange () {
if hooks.FlexibleHeightChange != nil {
hooks.FlexibleHeightChange()
}
}