feat: separate unit type from comment (now in quotes) in target dropdowns

This commit is contained in:
qm210 2024-10-27 08:26:03 +01:00
parent 56f5297188
commit 4e81fcc10f

View File

@ -340,7 +340,11 @@ func (p ParameterStyle) Layout(gtx C) D {
unitItems = make([]MenuItem, len(units))
for j, unit := range units {
id := unit.ID
unitItems[j].Text = fmt.Sprintf("%d: %s %s", j, unit.Type, unit.Comment)
text := unit.Type
if unit.Comment != "" {
text = fmt.Sprintf("%s \"%s\"", text, unit.Comment)
}
unitItems[j].Text = fmt.Sprintf("%d: %s", j, text)
unitItems[j].IconBytes = icons.NavigationChevronRight
unitItems[j].Doer = tracker.Allow(func() {
tracker.Int{IntData: p.w.Parameter}.Set(id)