mirror of
https://github.com/vsariola/sointu.git
synced 2025-07-18 21:14:31 -04:00
feat(tracker): change unit list into labels
This commit is contained in:
@ -108,9 +108,14 @@ func (t *Tracker) layoutUnitList() layout.Widget {
|
||||
for t.UnitBtns[i].Clicked() {
|
||||
t.CurrentUnit = i
|
||||
}
|
||||
btnStyle := material.Button(t.Theme, t.UnitBtns[i], u.Type)
|
||||
btnStyle.Background = transparent
|
||||
children[i] = layout.Rigid(btnStyle.Layout)
|
||||
i2 := i
|
||||
labelStyle := LabelStyle{Text: u.Type, ShadeColor: black, Color: white, Font: labelDefaultFont, FontSize: unit.Sp(12)}
|
||||
children[i] = layout.Rigid(func(gtx C) D {
|
||||
dims := labelStyle.Layout(gtx)
|
||||
gtx.Constraints = layout.Exact(dims.Size)
|
||||
t.UnitBtns[i2].Layout(gtx)
|
||||
return dims
|
||||
})
|
||||
}
|
||||
return layout.Flex{Axis: layout.Vertical}.Layout(gtx, children...)
|
||||
}
|
||||
|
Reference in New Issue
Block a user