widget: change Enum.Layout to follow layout protocol

Respect constraints and return dimensions.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2020-05-24 13:52:48 +02:00
parent 31d722d9eb
commit f2df7c1458
2 changed files with 13 additions and 1 deletions
+1
View File
@@ -37,6 +37,7 @@ func RadioButton(th *Theme, group *widget.Enum, key, label string) RadioButtonSt
// Layout updates enum and displays the radio button.
func (r RadioButtonStyle) Layout(gtx layout.Context) layout.Dimensions {
dims := r.layout(gtx, r.Group.Value == r.Key)
gtx.Constraints.Min = dims.Size
r.Group.Layout(gtx, r.Key)
return dims
}