Theming tweaks and rendering fixes
This commit is contained in:
parent
8dd506a007
commit
ee45b2fa60
@ -4,6 +4,7 @@ import "image"
|
|||||||
import "git.tebibyte.media/sashakoshka/tomo/input"
|
import "git.tebibyte.media/sashakoshka/tomo/input"
|
||||||
import "git.tebibyte.media/sashakoshka/tomo/theme"
|
import "git.tebibyte.media/sashakoshka/tomo/theme"
|
||||||
import "git.tebibyte.media/sashakoshka/tomo/config"
|
import "git.tebibyte.media/sashakoshka/tomo/config"
|
||||||
|
import "git.tebibyte.media/sashakoshka/tomo/artist"
|
||||||
import "git.tebibyte.media/sashakoshka/tomo/textdraw"
|
import "git.tebibyte.media/sashakoshka/tomo/textdraw"
|
||||||
import "git.tebibyte.media/sashakoshka/tomo/elements/core"
|
import "git.tebibyte.media/sashakoshka/tomo/elements/core"
|
||||||
|
|
||||||
@ -175,7 +176,7 @@ func (element *Checkbox) draw () {
|
|||||||
backgroundPattern.Draw(element.core, bounds)
|
backgroundPattern.Draw(element.core, bounds)
|
||||||
|
|
||||||
pattern := element.theme.Pattern(theme.PatternButton, state)
|
pattern := element.theme.Pattern(theme.PatternButton, state)
|
||||||
pattern.Draw(element.core, boxBounds)
|
artist.DrawBounds(element.core, pattern, boxBounds)
|
||||||
|
|
||||||
textBounds := element.drawer.LayoutBounds()
|
textBounds := element.drawer.LayoutBounds()
|
||||||
margin := element.theme.Margin(theme.PatternBackground)
|
margin := element.theme.Margin(theme.PatternBackground)
|
||||||
|
@ -67,7 +67,7 @@ func (entry *ListEntry) Draw (
|
|||||||
On: on,
|
On: on,
|
||||||
}
|
}
|
||||||
|
|
||||||
pattern := entry.theme.Pattern (theme.PatternRaised, state)
|
pattern := entry.theme.Pattern(theme.PatternRaised, state)
|
||||||
padding := entry.theme.Padding(theme.PatternRaised)
|
padding := entry.theme.Padding(theme.PatternRaised)
|
||||||
bounds := entry.Bounds().Add(offset)
|
bounds := entry.Bounds().Add(offset)
|
||||||
artist.DrawBounds(destination, pattern, bounds)
|
artist.DrawBounds(destination, pattern, bounds)
|
||||||
|
@ -118,6 +118,13 @@ func (element *Artist) draw () {
|
|||||||
Inset: artist.Inset { 8, 8, 8, 8 },
|
Inset: artist.Inset { 8, 8, 8, 8 },
|
||||||
}.Draw(c03, c03.Bounds())
|
}.Draw(c03, c03.Bounds())
|
||||||
|
|
||||||
|
// 1, 3
|
||||||
|
c13 := element.cellAt(1, 3)
|
||||||
|
patterns.Border {
|
||||||
|
Canvas: element.thingy(c42),
|
||||||
|
Inset: artist.Inset { 8, 8, 8, 8 },
|
||||||
|
}.Draw(c13, c13.Bounds().Inset(10))
|
||||||
|
|
||||||
// how long did that take to render?
|
// how long did that take to render?
|
||||||
drawTime := time.Since(drawStart)
|
drawTime := time.Since(drawStart)
|
||||||
textDrawer := textdraw.Drawer { }
|
textDrawer := textdraw.Drawer { }
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
@ -117,8 +117,17 @@ func (Default) Color (id Color, state State, c Case) color.RGBA {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Padding returns the default padding value for the given pattern.
|
// Padding returns the default padding value for the given pattern.
|
||||||
func (Default) Padding (pattern Pattern, c Case) artist.Inset {
|
func (Default) Padding (id Pattern, c Case) artist.Inset {
|
||||||
return artist.Inset { 8, 8, 8, 8 }
|
switch id {
|
||||||
|
case PatternSunken:
|
||||||
|
if c == C("basic", "list") {
|
||||||
|
return artist.Inset { 2, 2, 2, 2 }
|
||||||
|
} else {
|
||||||
|
return artist.Inset { 8, 8, 8, 8 }
|
||||||
|
}
|
||||||
|
case PatternGutter: return artist.Inset { }
|
||||||
|
default: return artist.Inset { 8, 8, 8, 8 }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Margin returns the default margin value for the given pattern.
|
// Margin returns the default margin value for the given pattern.
|
||||||
|
Reference in New Issue
Block a user