widget/material: add missing Update calls

Without the updates, the switch and radiobutton would use stale state
for layout.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2023-12-05 09:38:52 -06:00
parent d96c954769
commit c458eb30f0
2 changed files with 2 additions and 0 deletions
+1
View File
@@ -39,6 +39,7 @@ func Switch(th *Theme, swtch *widget.Bool, description string) SwitchStyle {
// Layout updates the switch and displays it.
func (s SwitchStyle) Layout(gtx layout.Context) layout.Dimensions {
s.Switch.Update(gtx)
trackWidth := gtx.Dp(36)
trackHeight := gtx.Dp(16)
thumbSize := gtx.Dp(20)