ecs #15

Merged
sashakoshka merged 41 commits from ecs into main 2023-04-19 22:29:08 -06:00
2 changed files with 14 additions and 3 deletions
Showing only changes of commit 6276327613 - Show all commits

View File

@ -279,6 +279,8 @@ func (Default) Padding (id tomo.Pattern, c tomo.Case) artist.Inset {
} else { } else {
return artist.I(8) return artist.I(8)
} }
case tomo.PatternTableCell: return artist.I(5)
case tomo.PatternTableHead: return artist.I(5)
case tomo.PatternGutter: return artist.I(0) case tomo.PatternGutter: return artist.I(0)
case tomo.PatternLine: return artist.I(1) case tomo.PatternLine: return artist.I(1)
case tomo.PatternMercury: return artist.I(5) case tomo.PatternMercury: return artist.I(5)
@ -288,7 +290,15 @@ func (Default) Padding (id tomo.Pattern, c tomo.Case) artist.Inset {
// Margin returns the default margin value for the given pattern. // Margin returns the default margin value for the given pattern.
func (Default) Margin (id tomo.Pattern, c tomo.Case) image.Point { func (Default) Margin (id tomo.Pattern, c tomo.Case) image.Point {
switch id {
case tomo.PatternSunken:
if c.Match("tomo", "list", "") {
return image.Pt(-1, -1)
} else {
return image.Pt(8, 8) return image.Pt(8, 8)
}
default: return image.Pt(8, 8)
}
} }
// Hints returns rendering optimization hints for a particular pattern. // Hints returns rendering optimization hints for a particular pattern.

View File

@ -40,7 +40,8 @@ func run () {
elements.NewCell(elements.NewLabel("Item 17", false)), elements.NewCell(elements.NewLabel("Item 17", false)),
elements.NewCell(elements.NewLabel("Item 18", false)), elements.NewCell(elements.NewLabel("Item 18", false)),
elements.NewCell(elements.NewLabel("Item 19", false)), elements.NewCell(elements.NewLabel("Item 19", false)),
elements.NewCell(elements.NewLabel("Item 20", false))) elements.NewCell(elements.NewLabel("Item 20", false)),
elements.NewCell(elements.NewLabel("Item 21", false)))
list.Collapse(0, 32) list.Collapse(0, 32)
scrollBar := elements.NewScrollBar(true) scrollBar := elements.NewScrollBar(true)
list.OnScrollBoundsChange (func () { list.OnScrollBoundsChange (func () {