Some theming tweaks

This commit is contained in:
Sasha Koshka 2023-04-18 03:12:36 -04:00
parent d44e7b51da
commit 6276327613
2 changed files with 14 additions and 3 deletions

View File

@ -279,16 +279,26 @@ func (Default) Padding (id tomo.Pattern, c tomo.Case) artist.Inset {
} else {
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.PatternLine: return artist.I(1)
case tomo.PatternMercury: return artist.I(5)
default: return artist.I(8)
default: return artist.I(8)
}
}
// Margin returns the default margin value for the given pattern.
func (Default) Margin (id tomo.Pattern, c tomo.Case) image.Point {
return image.Pt(8, 8)
switch id {
case tomo.PatternSunken:
if c.Match("tomo", "list", "") {
return image.Pt(-1, -1)
} else {
return image.Pt(8, 8)
}
default: return image.Pt(8, 8)
}
}
// 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 18", 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)
scrollBar := elements.NewScrollBar(true)
list.OnScrollBoundsChange (func () {