Skip to content

Commit

Permalink
fix(gioui): draw cursor in front of play marker in order editor
Browse files Browse the repository at this point in the history
  • Loading branch information
vsariola committed Mar 1, 2024
1 parent f0f3913 commit 07bf8f6
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions tracker/gioui/order_editor.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,15 @@ func (oe *OrderEditor) Layout(gtx C, t *Tracker) D {
return D{Size: image.Pt(gtx.Dp(patternCellWidth), h)}
}

rowTitle := func(gtx C, j int) D {
w := gtx.Dp(unit.Dp(30))
if playPos := t.PlayPosition(); t.SongPanel.PlayingBtn.Bool.Value() && j == playPos.OrderRow {
rowTitleBg := func(gtx C, j int) D {
if t.SongPanel.PlayingBtn.Bool.Value() && j == t.PlayPosition().OrderRow {
paint.FillShape(gtx.Ops, patternPlayColor, clip.Rect{Max: image.Pt(gtx.Constraints.Max.X, gtx.Dp(patternCellHeight))}.Op())
}
return D{}
}

rowTitle := func(gtx C, j int) D {
w := gtx.Dp(unit.Dp(30))
color := rowMarkerPatternTextColor
if l := t.Loop(); j >= l.Start && j < l.Start+l.Length {
color = loopMarkerColor
Expand Down Expand Up @@ -111,7 +115,7 @@ func (oe *OrderEditor) Layout(gtx C, t *Tracker) D {
return D{Size: image.Pt(gtx.Dp(patternCellWidth), gtx.Dp(patternCellHeight))}
}

table := FilledScrollTable(t.Theme, oe.scrollTable, cell, colTitle, rowTitle, nil, nil)
table := FilledScrollTable(t.Theme, oe.scrollTable, cell, colTitle, rowTitle, nil, rowTitleBg)
table.ColumnTitleHeight = orderTitleHeight

return table.Layout(gtx)
Expand Down

0 comments on commit 07bf8f6

Please sign in to comment.