From 4e81fcc10fb9c4ff676b5b2aa98bcc473dd201c4 Mon Sep 17 00:00:00 2001 From: qm210 Date: Sun, 27 Oct 2024 08:26:03 +0100 Subject: [PATCH] feat: separate unit type from comment (now in quotes) in target dropdowns --- tracker/gioui/unit_editor.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tracker/gioui/unit_editor.go b/tracker/gioui/unit_editor.go index 9d46e19..1277eda 100644 --- a/tracker/gioui/unit_editor.go +++ b/tracker/gioui/unit_editor.go @@ -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)