mirror of
https://github.com/vsariola/sointu.git
synced 2025-11-12 12:52:53 -05:00
drafting
This commit is contained in:
parent
f80e71d2ec
commit
e23b3f38c4
@ -3,6 +3,7 @@ package gioui
|
|||||||
import (
|
import (
|
||||||
"image"
|
"image"
|
||||||
|
|
||||||
|
"gioui.org/io/key"
|
||||||
"gioui.org/layout"
|
"gioui.org/layout"
|
||||||
"gioui.org/op/clip"
|
"gioui.org/op/clip"
|
||||||
"gioui.org/op/paint"
|
"gioui.org/op/paint"
|
||||||
@ -38,7 +39,39 @@ func NewInstrumentPresets(m *tracker.Model) *InstrumentPresets {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (ip *InstrumentPresets) update(gtx C) {
|
||||||
|
for {
|
||||||
|
event, ok := gtx.Event(
|
||||||
|
key.Filter{Focus: ip.resultList, Name: key.NameLeftArrow},
|
||||||
|
)
|
||||||
|
if !ok {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
if e, ok := event.(key.Event); ok && e.State == key.Press {
|
||||||
|
switch e.Name {
|
||||||
|
case key.NameLeftArrow:
|
||||||
|
ip.dirList.Focus()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for {
|
||||||
|
event, ok := gtx.Event(
|
||||||
|
key.Filter{Focus: ip.dirList, Name: key.NameRightArrow},
|
||||||
|
)
|
||||||
|
if !ok {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
if e, ok := event.(key.Event); ok && e.State == key.Press {
|
||||||
|
switch e.Name {
|
||||||
|
case key.NameRightArrow:
|
||||||
|
ip.resultList.Focus()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func (ip *InstrumentPresets) layout(gtx C) D {
|
func (ip *InstrumentPresets) layout(gtx C) D {
|
||||||
|
ip.update(gtx)
|
||||||
// get tracker from values
|
// get tracker from values
|
||||||
tr := TrackerFromContext(gtx)
|
tr := TrackerFromContext(gtx)
|
||||||
gmDlsBtn := ToggleBtn(tr.NoGmDls(), tr.Theme, ip.gmDlsBtn, "No gm.dls", "Exclude presets using gm.dls")
|
gmDlsBtn := ToggleBtn(tr.NoGmDls(), tr.Theme, ip.gmDlsBtn, "No gm.dls", "Exclude presets using gm.dls")
|
||||||
|
|||||||
Reference in New Issue
Block a user