widget: change Bool.Layout to follow layout protocol

Just like Clickable, Bool.Layout should respect constraints and
return its dimensions.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2020-05-24 13:50:03 +02:00
parent 3164a3fee7
commit 31d722d9eb
3 changed files with 15 additions and 9 deletions
+1
View File
@@ -32,6 +32,7 @@ func CheckBox(th *Theme, checkBox *widget.Bool, label string) CheckBoxStyle {
// Layout updates the checkBox and displays it.
func (c CheckBoxStyle) Layout(gtx layout.Context) layout.Dimensions {
dims := c.layout(gtx, c.CheckBox.Value)
gtx.Constraints.Min = dims.Size
c.CheckBox.Layout(gtx)
return dims
}