Allow menu records to be processed hierarchically by the UI driver

Nothing is actually processed in this way yet, but there is a new
assertion forbidding certain types of records from having children.

Because of this new assertion, our menutype tweaks must be moved up a
layer into internal/menus. They fit better there anyway.
This commit is contained in:
2020-03-31 23:29:43 +01:00
parent 7586b90f8a
commit 2ae3611d7f
5 changed files with 61 additions and 34 deletions

View File

@@ -10,11 +10,11 @@ import (
)
func init() {
registerBuilder(menus.TypeStatic, registerStatic)
registerBuilder(menus.TypeHypertext, registerHypertext)
registerBuilder(menus.TypeOverlay, registerOverlay)
registerBuilder(menus.TypeAnimationSample, registerAnimation)
registerBuilder(menus.TypeAnimationHover, registerAnimationHover)
registerBuilder(menus.TypeStatic, noChildren(registerStatic))
registerBuilder(menus.TypeHypertext, noChildren(registerHypertext))
registerBuilder(menus.TypeOverlay, noChildren(registerOverlay))
registerBuilder(menus.TypeAnimationSample, noChildren(registerAnimation))
registerBuilder(menus.TypeAnimationHover, noChildren(registerAnimationHover))
}
// A non-interactive element is not a widget; it merely displays some pixels and