Lists are a thing now

Looks like child bounds arent clipped properly though, ugh
This commit is contained in:
2023-04-18 02:59:44 -04:00
parent 6b13e772a9
commit 0bf5c3b86c
7 changed files with 420 additions and 95 deletions

View File

@@ -212,14 +212,9 @@ func (Default) Pattern (id tomo.Pattern, state tomo.State, c tomo.Case) artist.P
switch id {
case tomo.PatternBackground: return patterns.Uhex(0xaaaaaaFF)
case tomo.PatternDead: return defaultTextures[0][offset]
case tomo.PatternRaised:
if c.Match("tomo", "listEntry", "") {
return defaultTextures[10][offset]
} else {
return defaultTextures[1][offset]
}
case tomo.PatternSunken: return defaultTextures[2][offset]
case tomo.PatternPinboard: return defaultTextures[3][offset]
case tomo.PatternRaised: return defaultTextures[1][offset]
case tomo.PatternSunken: return defaultTextures[2][offset]
case tomo.PatternPinboard: return defaultTextures[3][offset]
case tomo.PatternButton:
switch {
case c.Match("tomo", "checkbox", ""):
@@ -272,16 +267,8 @@ func (Default) Color (id tomo.Color, state tomo.State, c tomo.Case) color.RGBA {
// Padding returns the default padding value for the given pattern.
func (Default) Padding (id tomo.Pattern, c tomo.Case) artist.Inset {
switch id {
case tomo.PatternRaised:
if c.Match("tomo", "listEntry", "") {
return artist.I(4, 8)
} else {
return artist.I(8)
}
case tomo.PatternSunken:
if c.Match("tomo", "list", "") {
return artist.I(4, 0, 3)
} else if c.Match("tomo", "progressBar", "") {
if c.Match("tomo", "progressBar", "") {
return artist.I(2, 1, 1, 2)
} else {
return artist.I(8)