Added the BackgroundParent interface
Parents are now able to draw backgrounds for their children. This means we can now have elements inside other elements that aren't restricted to one background color.
This commit is contained in:
@@ -200,13 +200,10 @@ func (element *Label) updateMinimumSize () {
|
||||
}
|
||||
|
||||
func (element *Label) draw () {
|
||||
element.core.DrawBackground (
|
||||
element.theme.Pattern(tomo.PatternBackground, tomo.State { }))
|
||||
|
||||
bounds := element.Bounds()
|
||||
|
||||
pattern := element.theme.Pattern (
|
||||
tomo.PatternBackground,
|
||||
tomo.State { })
|
||||
pattern.Draw(element.core, bounds)
|
||||
|
||||
textBounds := element.drawer.LayoutBounds()
|
||||
|
||||
foreground := element.theme.Color (
|
||||
|
||||
Reference in New Issue
Block a user