From 6b4c747fb5ce51a050b4190d98e39ac2665bf35e Mon Sep 17 00:00:00 2001 From: "Randall C. O'Reilly" Date: Mon, 17 Jun 2024 02:54:48 -0700 Subject: [PATCH] Restyle renabled in loopcontrol. --- egui/loopctrl.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/egui/loopctrl.go b/egui/loopctrl.go index e6cbf8e..e688670 100644 --- a/egui/loopctrl.go +++ b/egui/loopctrl.go @@ -31,13 +31,14 @@ func (gui *GUI) AddLooperCtrl(p *core.Plan, loops *looper.Manager, modes []etime for _, m := range modes { mode := m core.AddAt(p, mode.String()+"-run", func(w *core.Button) { + tb := p.Widget.(*core.Toolbar) w.SetText(mode.String() + " Run").SetIcon(icons.PlayArrow). SetTooltip("Run the " + mode.String() + " process"). FirstStyler(func(s *styles.Style) { s.SetEnabled(!gui.IsRunning) }). OnClick(func(e events.Event) { if !gui.IsRunning { gui.IsRunning = true - // tb.Restyle() // todo: need obj on plan + tb.Restyle() go func() { loops.Run(mode) gui.Stopped() @@ -55,6 +56,7 @@ func (gui *GUI) AddLooperCtrl(p *core.Plan, loops *looper.Manager, modes []etime } core.AddAt(p, mode.String()+"-step", func(w *core.Button) { + tb := p.Widget.(*core.Toolbar) w.SetText("Step").SetIcon(icons.SkipNext). SetTooltip("Step the " + mode.String() + " process according to the following step level and N"). FirstStyler(func(s *styles.Style) { @@ -64,7 +66,7 @@ func (gui *GUI) AddLooperCtrl(p *core.Plan, loops *looper.Manager, modes []etime OnClick(func(e events.Event) { if !gui.IsRunning { gui.IsRunning = true - // tb.Restyle() + tb.Restyle() go func() { stack := loops.Stacks[mode] loops.Step(mode, stepN[stack.StepLevel.String()], stack.StepLevel)