From dca1eaefb5084159c41dc4b9475d88b245b4454f Mon Sep 17 00:00:00 2001 From: Sasha Koshka Date: Mon, 13 May 2024 19:48:29 -0400 Subject: [PATCH] Add SunkenContainer --- container.go | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/container.go b/container.go index f1354fe..aea3a9b 100644 --- a/container.go +++ b/container.go @@ -23,13 +23,23 @@ func newContainer (layout tomo.Layout, children ...tomo.Object) *Container { return this } -// NewOuterContainer creates a new container that has padding around it. +// NewOuterContainer creates a new container that has padding around it, as well +// as a solid background color. It is meant to be used as a root container for a +// window, tab pane, etc. func NewOuterContainer (layout tomo.Layout, children ...tomo.Object) *Container { this := newContainer(layout, children...) theme.Apply(this, theme.R("objects", "Container", "outer")) return this } +// NewSunkenContainer creates a new container with a sunken style and padding +// 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...) + theme.Apply(this, theme.R("objects", "Container", "sunken")) + 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...)