build: upgrade to latest gioui

This commit is contained in:
5684185+vsariola@users.noreply.github.com
2024-10-05 12:34:02 +03:00
parent 8fd2df19a1
commit bf5579a2d2
4 changed files with 39 additions and 84 deletions

View File

@ -100,10 +100,9 @@ func NewTracker(model *tracker.Model) *Tracker {
func (t *Tracker) Main() {
titleFooter := ""
w := app.NewWindow(
app.Size(unit.Dp(800), unit.Dp(600)),
app.Title("Sointu Tracker"),
)
w := new(app.Window)
w.Option(app.Title("Sointu Tracker"))
w.Option(app.Size(unit.Dp(800), unit.Dp(600)))
t.InstrumentEditor.Focus()
recoveryTicker := time.NewTicker(time.Second * 30)
t.Explorer = explorer.NewExplorer(w)
@ -135,10 +134,9 @@ func (t *Tracker) Main() {
}
if !t.Quitted() {
// TODO: uh oh, there's no way of canceling the destroyevent in gioui? so we create a new window just to show the dialog
w = app.NewWindow(
app.Size(unit.Dp(800), unit.Dp(600)),
app.Title("Sointu Tracker"),
)
w = new(app.Window)
w.Option(app.Title("Sointu Tracker"))
w.Option(app.Size(unit.Dp(800), unit.Dp(600)))
t.Explorer = explorer.NewExplorer(w)
go eventLoop(w, events, acks)
}
@ -172,7 +170,7 @@ func eventLoop(w *app.Window, events chan<- event.Event, acks <-chan struct{}) {
// Iterate window events, sending each to the old event loop and waiting for
// a signal that processing is complete before iterating again.
for {
ev := w.NextEvent()
ev := w.Event()
events <- ev
<-acks
if _, ok := ev.(app.DestroyEvent); ok {

View File

@ -242,9 +242,9 @@ func (p ParameterStyle) Layout(gtx C) D {
case tracker.IntegerParameter:
for p.Focus {
e, ok := gtx.Event(pointer.Filter{
Target: &p.w.floatWidget,
Kinds: pointer.Scroll,
ScrollBounds: image.Rectangle{Min: image.Pt(0, -1e6), Max: image.Pt(0, 1e6)},
Target: &p.w.floatWidget,
Kinds: pointer.Scroll,
ScrollY: pointer.ScrollRange{-1e6, 1e6},
})
if !ok {
break