feat(tracker/gioui): new tab order logic and refactor instrument editor

This commit is contained in:
5684185+vsariola@users.noreply.github.com
2025-06-25 12:53:57 +03:00
parent d276f52942
commit 08c36ed462
13 changed files with 741 additions and 639 deletions

View File

@ -259,48 +259,28 @@ func (t *Tracker) KeyEvent(e key.Event, gtx C) {
case "Paste":
gtx.Execute(clipboard.ReadCmd{Tag: t})
case "OrderEditorFocus":
t.OrderEditor.scrollTable.Focus()
gtx.Execute(key.FocusCmd{Tag: t.OrderEditor.scrollTable})
case "TrackEditorFocus":
t.TrackEditor.scrollTable.Focus()
case "InstrumentEditorFocus":
t.InstrumentEditor.Focus()
gtx.Execute(key.FocusCmd{Tag: t.TrackEditor.scrollTable})
case "InstrumentListFocus":
gtx.Execute(key.FocusCmd{Tag: t.PatchPanel.instrList.instrumentDragList})
case "UnitListFocus":
gtx.Execute(key.FocusCmd{Tag: t.PatchPanel.unitList.dragList})
case "FocusPrev":
switch {
case t.OrderEditor.scrollTable.Focused(gtx):
t.InstrumentEditor.unitEditor.sliderList.Focus()
case t.TrackEditor.scrollTable.Focused(gtx):
t.OrderEditor.scrollTable.Focus()
case t.InstrumentEditor.Focused(gtx):
if t.InstrEnlarged().Value() {
t.InstrumentEditor.unitEditor.sliderList.Focus()
} else {
t.TrackEditor.scrollTable.Focus()
}
default:
t.InstrumentEditor.Focus()
}
t.FocusPrev(gtx, false)
case "FocusPrevInto":
t.FocusPrev(gtx, true)
case "FocusNext":
switch {
case t.OrderEditor.scrollTable.Focused(gtx):
t.TrackEditor.scrollTable.Focus()
case t.TrackEditor.scrollTable.Focused(gtx):
t.InstrumentEditor.Focus()
case t.InstrumentEditor.Focused(gtx):
t.InstrumentEditor.unitEditor.sliderList.Focus()
default:
if t.InstrEnlarged().Value() {
t.InstrumentEditor.Focus()
} else {
t.OrderEditor.scrollTable.Focus()
}
}
t.FocusNext(gtx, false)
case "FocusNextInto":
t.FocusNext(gtx, true)
default:
if action[:4] == "Note" {
val, err := strconv.Atoi(string(action[4:]))
if err != nil {
break
}
instr := t.InstrumentEditor.instrumentDragList.TrackerList.Selected()
instr := t.Model.Instruments().List().Selected()
n := noteAsValue(t.Model.Octave().Value(), val-12)
t.KeyNoteMap.Press(e.Name, tracker.NoteEvent{Channel: instr, Note: n})
}