Skip to content

Commit

Permalink
repeat clickable step button
Browse files Browse the repository at this point in the history
  • Loading branch information
rcoreilly committed Mar 18, 2024
1 parent dec6de1 commit 3fbca76
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion egui/loopctrl.go
Expand Up @@ -5,6 +5,7 @@
package egui

import (
"cogentcore.org/core/abilities"
"cogentcore.org/core/events"
"cogentcore.org/core/gi"
"cogentcore.org/core/icons"
Expand Down Expand Up @@ -53,7 +54,10 @@ func (gui *GUI) AddLooperCtrl(tb *gi.Toolbar, loops *looper.Manager, modes []eti
}
gi.NewButton(tb).SetText("Step").SetIcon(icons.SkipNext).
SetTooltip("Step the " + mode.String() + " process according to the following step level and N").
StyleFirst(func(s *styles.Style) { s.SetEnabled(!gui.IsRunning) }).
StyleFirst(func(s *styles.Style) {
s.SetEnabled(!gui.IsRunning)
s.SetAbilities(true, abilities.RepeatClickable)
}).
OnClick(func(e events.Event) {
if !gui.IsRunning {
gui.IsRunning = true
Expand Down

0 comments on commit 3fbca76

Please sign in to comment.