mirror of
https://github.com/vsariola/sointu.git
synced 2025-07-20 05:54:34 -04:00
refactor(tracker/gioui): move element etc. functions away from style
Now the element / fg / bg functions are passed to the actual Layout function, not first put to the style. This avoids moving of the element function to heap.
This commit is contained in:
parent
de2e64533d
commit
d20a23d57b
@ -118,8 +118,8 @@ func (pe *UnitEditor) layoutSliders(gtx C, t *Tracker) D {
|
||||
return D{Size: image.Pt(gtx.Constraints.Max.X, dims.Size.Y)}
|
||||
}
|
||||
|
||||
fdl := FilledDragList(t.Theme, pe.sliderList, element, nil)
|
||||
dims := fdl.Layout(gtx)
|
||||
fdl := FilledDragList(t.Theme, pe.sliderList)
|
||||
dims := fdl.Layout(gtx, element, nil)
|
||||
gtx.Constraints = layout.Exact(dims.Size)
|
||||
fdl.LayoutScrollBar(gtx)
|
||||
return dims
|
||||
@ -191,8 +191,8 @@ func (pe *UnitEditor) layoutUnitTypeChooser(gtx C, t *Tracker) D {
|
||||
}
|
||||
return w.Layout(gtx)
|
||||
}
|
||||
fdl := FilledDragList(t.Theme, pe.searchList, element, nil)
|
||||
dims := fdl.Layout(gtx)
|
||||
fdl := FilledDragList(t.Theme, pe.searchList)
|
||||
dims := fdl.Layout(gtx, element, nil)
|
||||
gtx.Constraints = layout.Exact(dims.Size)
|
||||
fdl.LayoutScrollBar(gtx)
|
||||
return dims
|
||||
|
Reference in New Issue
Block a user