~whereswaldon/gio-x

d4cc70e5a8d06ea6b839fe7d138d53cbf756848c — Chris Waldon 14 days ago df60cdc main
component: allow specifying discloser control and summary alignment

Signed-off-by: Chris Waldon <christopher.waldon.dev@gmail.com>
1 files changed, 5 insertions(+), 1 deletions(-)

M component/discloser.go
M component/discloser.go => component/discloser.go +5 -1
@@ 49,12 49,16 @@ type DiscloserStyle struct {
	// ControlSide defines whether the control widget is drawn to the
	// left or right of the summary widget.
	ControlSide Side
	// Alignment dictates how the control and summary are aligned relative
	// to one another.
	Alignment layout.Alignment
}

// Discloser configures a discloser from the provided theme and state.
func Discloser(th *material.Theme, state *DiscloserState) DiscloserStyle {
	return DiscloserStyle{
		DiscloserState: state,
		Alignment:      layout.Middle,
	}
}



@@ 80,7 84,7 @@ func (d DiscloserStyle) Layout(gtx C, control, summary, detail layout.Widget) D 
				return d.Clickable.Layout(gtx, control)
			}
			return layout.Flex{
				Alignment: layout.Middle,
				Alignment: d.Alignment,
			}.Layout(gtx,
				layout.Rigid(func(gtx C) D {
					if d.ControlSide == Left {