Store role in Boxes

This commit is contained in:
2024-06-03 21:13:18 -04:00
parent d8ae20d739
commit 2ab920eb26
14 changed files with 40 additions and 19 deletions

View File

@@ -27,7 +27,8 @@ func newContainer (layout tomo.Layout, children ...tomo.Object) *Container {
// window, tab pane, etc.
func NewOuterContainer (layout tomo.Layout, children ...tomo.Object) *Container {
this := newContainer(layout, children...)
tomo.Apply(this, tomo.R("objects", "Container", "outer"))
this.SetRole(tomo.R("objects", "Container", "outer"))
tomo.Apply(this)
return this
}
@@ -35,14 +36,16 @@ func NewOuterContainer (layout tomo.Layout, children ...tomo.Object) *Container
// around it. It is meant to be used as a root container for a ScrollContainer.
func NewSunkenContainer (layout tomo.Layout, children ...tomo.Object) *Container {
this := newContainer(layout, children...)
tomo.Apply(this, tomo.R("objects", "Container", "sunken"))
this.SetRole(tomo.R("objects", "Container", "sunken"))
tomo.Apply(this)
return this
}
// NewInnerContainer creates a new container that has no padding around it.
func NewInnerContainer (layout tomo.Layout, children ...tomo.Object) *Container {
this := newContainer(layout, children...)
tomo.Apply(this, tomo.R("objects", "Container", "inner"))
this.SetRole(tomo.R("objects", "Container", "inner"))
tomo.Apply(this)
return this
}