fix(tracker): unit searching to work more reliably

This commit is contained in:
5684185+vsariola@users.noreply.github.com
2024-02-17 20:54:46 +02:00
parent db6c9f6052
commit 2b3f6d8200
7 changed files with 39 additions and 15 deletions

View File

@ -59,8 +59,8 @@ func (pe *UnitEditor) Layout(gtx C, t *Tracker) D {
key.InputOp{Tag: &pe.tag, Keys: "←|Shift-←|→|Shift-→|⎋"}.Add(gtx.Ops)
editorFunc := pe.layoutSliders
str := tracker.String{StringData: (*tracker.UnitSearch)(t.Model)}
if str.Value() != t.Model.Units().SelectedType() || pe.sliderList.TrackerList.Count() == 0 {
if t.UnitSearching().Value() || pe.sliderList.TrackerList.Count() == 0 {
editorFunc = pe.layoutUnitTypeChooser
}
return Surface{Gray: 24, Focus: t.InstrumentEditor.wasFocused}.Layout(gtx, func(gtx C) D {