Stripes :)))))

This commit is contained in:
Sasha Koshka 2023-01-21 21:24:02 -05:00
parent 5990496455
commit 90067a6ded
2 changed files with 18 additions and 4 deletions

View File

@ -274,7 +274,7 @@ func (element *ScrollContainer) recalculate () {
horizontal := &element.horizontal
vertical := &element.vertical
bounds := element.Bounds()
thickness := theme.Padding() * 2
thickness := theme.ScrollBarWidth()
// calculate child size
element.childWidth = bounds.Dx()
@ -401,8 +401,8 @@ func (element *ScrollContainer) dragVerticalBar (mousePosition image.Point) {
}
func (element *ScrollContainer) updateMinimumSize () {
width := theme.Padding() * 2
height := theme.Padding() * 2
width := theme.ScrollBarWidth()
height := theme.ScrollBarWidth()
if element.child != nil {
childWidth, childHeight := element.child.MinimumSize()
width += childWidth

View File

@ -32,7 +32,17 @@ var sunkenPattern = artist.NewMultiBordered (
Shadow: artist.NewUniform(hex(0x97a09cFF)),
},
},
artist.Stroke { Pattern: artist.NewUniform(hex(0x97a09cFF)) })
// artist.Stroke { Pattern: artist.NewUniform(hex(0x97a09cFF)) },
artist.Stroke { Pattern: artist.Striped {
First: artist.Stroke {
Weight: 2,
Pattern: artist.NewUniform(hex(0x97a09cFF)),
},
Second: artist.Stroke {
Weight: 1,
Pattern: artist.NewUniform(hex(0x6e8079FF)),
},
}})
var raisedPattern = artist.NewMultiBordered (
artist.Stroke { Weight: 1, Pattern: strokePattern },
@ -109,6 +119,10 @@ func Padding () int {
return 8
}
func ScrollBarWidth () int {
return Padding() * 2
}
// SinkOffsetVector specifies a vector for things such as text to move by when a
// "sinking in" effect is desired, such as a button label during a button press.
func SinkOffsetVector () image.Point {