mirror of
https://github.com/vsariola/sointu.git
synced 2025-07-18 21:14:31 -04:00
refactor(tracker): move instrument related stuff from layout.go to instruments.go
the code related to handling instrument button actions definitely should be in instruments.go, not layout.go
This commit is contained in:
@ -14,15 +14,15 @@ import (
|
||||
"golang.org/x/exp/shiny/materialdesign/icons"
|
||||
)
|
||||
|
||||
func (t *Tracker) updateInstrumentScroll() {
|
||||
func (t *Tracker) layoutInstruments(gtx C) D {
|
||||
if t.CurrentInstrument > 7 {
|
||||
t.InstrumentDragList.List.Position.First = t.CurrentInstrument - 7
|
||||
} else {
|
||||
t.InstrumentDragList.List.Position.First = 0
|
||||
}
|
||||
}
|
||||
|
||||
func (t *Tracker) layoutInstruments(gtx C) D {
|
||||
for t.NewInstrumentBtn.Clicked() {
|
||||
t.AddInstrument()
|
||||
}
|
||||
btnStyle := material.IconButton(t.Theme, t.NewInstrumentBtn, widgetForIcon(icons.ContentAdd))
|
||||
btnStyle.Background = transparent
|
||||
btnStyle.Inset = layout.UniformInset(unit.Dp(6))
|
||||
|
Reference in New Issue
Block a user