mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-06 18:05:35 +00:00
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:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user