mirror of
https://github.com/vsariola/sointu.git
synced 2025-06-04 01:28:45 -04:00
feat(tracker): layout patterns in the top left
This commit is contained in:
parent
34eecd59f5
commit
2b38297da2
@ -9,13 +9,6 @@ import (
|
||||
func (t *Tracker) Layout(gtx layout.Context) {
|
||||
layout.Flex{Axis: layout.Vertical}.Layout(gtx,
|
||||
layout.Rigid(t.layoutControls),
|
||||
layout.Rigid(Lowered(t.layoutPatterns(
|
||||
t.song.Tracks,
|
||||
t.ActiveTrack,
|
||||
t.DisplayPattern,
|
||||
t.CursorColumn,
|
||||
t.PlayPattern,
|
||||
))),
|
||||
layout.Flexed(1, Lowered(t.layoutTracker)),
|
||||
)
|
||||
}
|
||||
@ -45,8 +38,14 @@ func (t *Tracker) layoutTracker(gtx layout.Context) layout.Dimensions {
|
||||
func (t *Tracker) layoutControls(gtx layout.Context) layout.Dimensions {
|
||||
gtx.Constraints.Min.Y = 200
|
||||
gtx.Constraints.Max.Y = 200
|
||||
return layout.Stack{Alignment: layout.NW}.Layout(gtx,
|
||||
layout.Expanded(t.QuitButton.Layout),
|
||||
layout.Stacked(Raised(Label(fmt.Sprintf("Current octave: %v", t.CurrentOctave), white))),
|
||||
return layout.Flex{Axis: layout.Horizontal}.Layout(gtx,
|
||||
layout.Rigid(Lowered(t.layoutPatterns(
|
||||
t.song.Tracks,
|
||||
t.ActiveTrack,
|
||||
t.DisplayPattern,
|
||||
t.CursorColumn,
|
||||
t.PlayPattern,
|
||||
))),
|
||||
layout.Flexed(1, Raised(Label(fmt.Sprintf("Current octave: %v", t.CurrentOctave), white))),
|
||||
)
|
||||
}
|
||||
|
@ -26,7 +26,6 @@ func (t *Tracker) layoutPatterns(tracks []sointu.Track, activeTrack, cursorPatte
|
||||
paint.FillShape(gtx.Ops, panelColor, clip.Rect{Max: image.Pt(gtx.Constraints.Max.X, trackRowHeight)}.Op())
|
||||
for i, track := range tracks {
|
||||
pop := op.Push(gtx.Ops)
|
||||
gtx.Constraints.Max.X = patternCellWidth
|
||||
clip.Rect{Max: gtx.Constraints.Max}.Add(gtx.Ops)
|
||||
if activeTrack == i {
|
||||
paint.FillShape(gtx.Ops, activeTrackColor, clip.Rect{
|
||||
|
Loading…
x
Reference in New Issue
Block a user