Oh yeah yeah!

This commit is contained in:
2023-04-18 03:23:51 -04:00
parent 6276327613
commit a2b1ac0c73
3 changed files with 32 additions and 23 deletions

View File

@@ -58,6 +58,10 @@ func (element *List) Draw (destination canvas.Canvas) {
}
func (element *List) Layout () {
if element.scroll.Y > element.maxScrollHeight() {
element.scroll.Y = element.maxScrollHeight()
}
margin := element.theme.Margin(tomo.PatternSunken)
padding := element.theme.Padding(tomo.PatternSunken)
bounds := padding.Apply(element.entity.Bounds())

View File

@@ -198,7 +198,10 @@ func (element *Scroll) updateMinimumSize () {
}
func (element *Scroll) updateEnabled () {
horizontal, vertical := element.child.ScrollAxes()
horizontal, vertical := false, false
if element.child != nil {
horizontal, vertical = element.child.ScrollAxes()
}
if element.horizontal != nil {
element.horizontal.SetEnabled(horizontal)
}