mirror of
https://github.com/vsariola/sointu.git
synced 2025-06-04 01:28:45 -04:00
feat(tracker): move octave buttons to the bottom right
This commit is contained in:
parent
82771832ed
commit
6bdd212336
@ -88,16 +88,39 @@ func (t *Tracker) layoutTracker(gtx layout.Context) layout.Dimensions {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
in2 := layout.UniformInset(unit.Dp(8))
|
in2 := layout.UniformInset(unit.Dp(8))
|
||||||
buttons := layout.Rigid(func(gtx layout.Context) layout.Dimensions {
|
for t.OctaveUpBtn.Clicked() {
|
||||||
paint.FillShape(gtx.Ops, trackMenuSurfaceColor, clip.Rect{
|
t.ChangeOctave(1)
|
||||||
Max: gtx.Constraints.Max,
|
}
|
||||||
}.Op())
|
for t.OctaveDownBtn.Clicked() {
|
||||||
iconBtn := material.IconButton(t.Theme, t.NewTrackBtn, addIcon)
|
t.ChangeOctave(-1)
|
||||||
if t.song.TotalTrackVoices() >= t.song.Patch.TotalVoices() {
|
}
|
||||||
iconBtn.Background = disabledContainerColor
|
menu := layout.Rigid(func(gtx layout.Context) layout.Dimensions {
|
||||||
iconBtn.Color = disabledTextColor
|
newTrack := layout.Rigid(func(gtx layout.Context) layout.Dimensions {
|
||||||
}
|
paint.FillShape(gtx.Ops, trackMenuSurfaceColor, clip.Rect{
|
||||||
return in2.Layout(gtx, iconBtn.Layout)
|
Max: gtx.Constraints.Max,
|
||||||
|
}.Op())
|
||||||
|
iconBtn := material.IconButton(t.Theme, t.NewTrackBtn, addIcon)
|
||||||
|
if t.song.TotalTrackVoices() >= t.song.Patch.TotalVoices() {
|
||||||
|
iconBtn.Background = disabledContainerColor
|
||||||
|
iconBtn.Color = disabledTextColor
|
||||||
|
}
|
||||||
|
return in2.Layout(gtx, iconBtn.Layout)
|
||||||
|
})
|
||||||
|
octLabel := layout.Rigid(Label("OCT:", white))
|
||||||
|
in := layout.UniformInset(unit.Dp(1))
|
||||||
|
octRow := layout.Rigid(func(gtx layout.Context) layout.Dimensions {
|
||||||
|
return layout.Flex{Axis: layout.Horizontal}.Layout(
|
||||||
|
gtx,
|
||||||
|
layout.Rigid(func(gtx layout.Context) layout.Dimensions {
|
||||||
|
return in.Layout(gtx, smallButton(material.IconButton(t.Theme, t.OctaveUpBtn, upIcon)).Layout)
|
||||||
|
}),
|
||||||
|
layout.Rigid(Label(fmt.Sprintf("%v", t.CurrentOctave), white)),
|
||||||
|
layout.Rigid(func(gtx layout.Context) layout.Dimensions {
|
||||||
|
return in.Layout(gtx, smallButton(material.IconButton(t.Theme, t.OctaveDownBtn, downIcon)).Layout)
|
||||||
|
}),
|
||||||
|
)
|
||||||
|
})
|
||||||
|
return layout.Flex{Axis: layout.Vertical}.Layout(gtx, newTrack, octLabel, octRow)
|
||||||
})
|
})
|
||||||
go func() {
|
go func() {
|
||||||
for t.NewTrackBtn.Clicked() {
|
for t.NewTrackBtn.Clicked() {
|
||||||
@ -115,7 +138,7 @@ func (t *Tracker) layoutTracker(gtx layout.Context) layout.Dimensions {
|
|||||||
}
|
}
|
||||||
return dims
|
return dims
|
||||||
}),
|
}),
|
||||||
buttons,
|
menu,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -130,12 +153,6 @@ func (t *Tracker) layoutControls(gtx layout.Context) layout.Dimensions {
|
|||||||
in := layout.UniformInset(unit.Dp(1))
|
in := layout.UniformInset(unit.Dp(1))
|
||||||
|
|
||||||
go func() {
|
go func() {
|
||||||
for t.OctaveUpBtn.Clicked() {
|
|
||||||
t.ChangeOctave(1)
|
|
||||||
}
|
|
||||||
for t.OctaveDownBtn.Clicked() {
|
|
||||||
t.ChangeOctave(-1)
|
|
||||||
}
|
|
||||||
for t.BPMUpBtn.Clicked() {
|
for t.BPMUpBtn.Clicked() {
|
||||||
t.ChangeBPM(1)
|
t.ChangeBPM(1)
|
||||||
}
|
}
|
||||||
@ -155,13 +172,6 @@ func (t *Tracker) layoutControls(gtx layout.Context) layout.Dimensions {
|
|||||||
t.CursorColumn,
|
t.CursorColumn,
|
||||||
playPat,
|
playPat,
|
||||||
)),
|
)),
|
||||||
layout.Rigid(Label(fmt.Sprintf("OCT: %v", t.CurrentOctave), white)),
|
|
||||||
layout.Rigid(func(gtx layout.Context) layout.Dimensions {
|
|
||||||
return in.Layout(gtx, smallButton(material.IconButton(t.Theme, t.OctaveUpBtn, upIcon)).Layout)
|
|
||||||
}),
|
|
||||||
layout.Rigid(func(gtx layout.Context) layout.Dimensions {
|
|
||||||
return in.Layout(gtx, smallButton(material.IconButton(t.Theme, t.OctaveDownBtn, downIcon)).Layout)
|
|
||||||
}),
|
|
||||||
layout.Rigid(Label(fmt.Sprintf("BPM: %3v", t.song.BPM), white)),
|
layout.Rigid(Label(fmt.Sprintf("BPM: %3v", t.song.BPM), white)),
|
||||||
layout.Rigid(func(gtx layout.Context) layout.Dimensions {
|
layout.Rigid(func(gtx layout.Context) layout.Dimensions {
|
||||||
return in.Layout(gtx, smallButton(material.IconButton(t.Theme, t.BPMUpBtn, upIcon)).Layout)
|
return in.Layout(gtx, smallButton(material.IconButton(t.Theme, t.BPMUpBtn, upIcon)).Layout)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user