Some theming tweaks
This commit is contained in:
parent
d44e7b51da
commit
6276327613
@ -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.
|
||||||
|
@ -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 () {
|
||||||
|
Reference in New Issue
Block a user