Added a case specifier to the theme API

This will allow themes to pull off some cool dirty tricks without
screwing anything up
This commit is contained in:
2023-01-30 01:30:13 -05:00
parent 2c55824920
commit 174beba79f
12 changed files with 147 additions and 31 deletions

View File

@@ -6,6 +6,8 @@ import "git.tebibyte.media/sashakoshka/tomo/theme"
import "git.tebibyte.media/sashakoshka/tomo/artist"
import "git.tebibyte.media/sashakoshka/tomo/elements/core"
var containerCase = theme.C("basic", "container")
// Container is an element capable of containg other elements, and arranging
// them in a layout.
type Container struct {
@@ -473,7 +475,9 @@ func (element *Container) recalculate () {
func (element *Container) draw () {
bounds := element.core.Bounds()
pattern, _ := theme.BackgroundPattern(theme.PatternState { })
pattern, _ := theme.BackgroundPattern (theme.PatternState {
Case: containerCase,
})
artist.FillRectangle(element.core, pattern, bounds)
for _, entry := range element.children {