feat(tracker): add step parameter to advance cursor after edit

The step is currently in the song panel; might consider putting it somewhere else.

Closes #6
This commit is contained in:
vsariola
2021-02-16 09:29:02 +02:00
parent 366a05c766
commit 803184cbe7
3 changed files with 40 additions and 2 deletions

View File

@ -175,6 +175,19 @@ func (t *Tracker) layoutSongOptions(gtx C) D {
}),
)
}),
layout.Rigid(func(gtx C) D {
return layout.Flex{Axis: layout.Horizontal}.Layout(gtx,
layout.Rigid(Label("STP:", white)),
layout.Rigid(func(gtx layout.Context) layout.Dimensions {
numStyle := NumericUpDown(t.Theme, t.Step, 0, 8)
numStyle.UnitsPerStep = unit.Dp(20)
gtx.Constraints.Min.Y = gtx.Px(unit.Dp(20))
gtx.Constraints.Min.X = gtx.Px(unit.Dp(70))
dims := in.Layout(gtx, numStyle.Layout)
return dims
}),
)
}),
layout.Rigid(func(gtx C) D {
gtx.Constraints.Min = image.Pt(0, 0)
return panicBtnStyle.Layout(gtx)