From d96c2ea9451d9bad4e71eb4cae648d64adc693ee Mon Sep 17 00:00:00 2001 From: "5684185+vsariola@users.noreply.github.com" <5684185+vsariola@users.noreply.github.com> Date: Mon, 5 May 2025 19:58:58 +0300 Subject: [PATCH] drafting --- tracker/gioui/theme.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tracker/gioui/theme.go b/tracker/gioui/theme.go index 55c9e3e..2442844 100644 --- a/tracker/gioui/theme.go +++ b/tracker/gioui/theme.go @@ -108,14 +108,14 @@ func NewTheme() *Theme { fmt.Printf(string(str)) ReadCustomConfigYml("theme.yml", &theme) theme.Material.Shaper = &text.Shaper{} - theme.Material.Icon.CheckBoxChecked = mustIcon(widget.NewIcon(icons.ToggleCheckBox)) - theme.Material.Icon.CheckBoxUnchecked = mustIcon(widget.NewIcon(icons.ToggleCheckBoxOutlineBlank)) - theme.Material.Icon.RadioChecked = mustIcon(widget.NewIcon(icons.ToggleRadioButtonChecked)) - theme.Material.Icon.RadioUnchecked = mustIcon(widget.NewIcon(icons.ToggleRadioButtonUnchecked)) + theme.Material.Icon.CheckBoxChecked = must(widget.NewIcon(icons.ToggleCheckBox)) + theme.Material.Icon.CheckBoxUnchecked = must(widget.NewIcon(icons.ToggleCheckBoxOutlineBlank)) + theme.Material.Icon.RadioChecked = must(widget.NewIcon(icons.ToggleRadioButtonChecked)) + theme.Material.Icon.RadioUnchecked = must(widget.NewIcon(icons.ToggleRadioButtonUnchecked)) return &theme } -func mustIcon(ic *widget.Icon, err error) *widget.Icon { +func must[T any](ic T, err error) T { if err != nil { panic(err) }