~eliasnaur/gio

679bf092cb8326afa16fe0a2063ce8ec062c661a — Egon Elbre 4 months ago e71bf13
layout: add Spacer

Signed-off-by: Egon Elbre <egonelbre@gmail.com>
1 files changed, 14 insertions(+), 0 deletions(-)

M layout/layout.go
M layout/layout.go => layout/layout.go +14 -0
@@ 194,6 194,20 @@ func (d Direction) Layout(gtx Context, w Widget) Dimensions {
	}
}

// Spacer adds space between widgets.
type Spacer struct {
	Width, Height unit.Value
}

func (s Spacer) Layout(gtx Context) Dimensions {
	return Dimensions{
		Size: image.Point{
			X: gtx.Px(s.Width),
			Y: gtx.Px(s.Height),
		},
	}
}

func (a Alignment) String() string {
	switch a {
	case Start: