mirror of
https://github.com/vsariola/sointu.git
synced 2025-07-18 21:14:31 -04:00
feat(tracker): make clicks change the focused panel
This commit is contained in:
@ -14,7 +14,23 @@ import (
|
||||
"golang.org/x/exp/shiny/materialdesign/icons"
|
||||
)
|
||||
|
||||
var instrumentPointerTag = false
|
||||
|
||||
func (t *Tracker) layoutInstruments(gtx C) D {
|
||||
for _, ev := range gtx.Events(&instrumentPointerTag) {
|
||||
e, ok := ev.(pointer.Event)
|
||||
if !ok {
|
||||
continue
|
||||
}
|
||||
if e.Type == pointer.Press {
|
||||
t.EditMode = EditUnits
|
||||
}
|
||||
}
|
||||
rect := image.Rect(0, 0, gtx.Constraints.Max.X, gtx.Constraints.Max.Y)
|
||||
pointer.Rect(rect).Add(gtx.Ops)
|
||||
pointer.InputOp{Tag: &instrumentPointerTag,
|
||||
Types: pointer.Press,
|
||||
}.Add(gtx.Ops)
|
||||
if t.CurrentInstrument > 7 {
|
||||
t.InstrumentDragList.List.Position.First = t.CurrentInstrument - 7
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user