about summary refs log tree commit diff stats
path: root/widgets/spinner.go
diff options
context:
space:
mode:
Diffstat (limited to 'widgets/spinner.go')
-rw-r--r--widgets/spinner.go10
1 files changed, 2 insertions, 8 deletions
diff --git a/widgets/spinner.go b/widgets/spinner.go
index 0ab3e13..bb7dbe8 100644
--- a/widgets/spinner.go
+++ b/widgets/spinner.go
@@ -23,8 +23,8 @@ var (
 )
 
 type Spinner struct {
+	ui.Invalidatable
 	frame        int64 // access via atomic
-	onInvalidate func(d ui.Drawable)
 	stop         chan struct{}
 }
 
@@ -84,12 +84,6 @@ func (s *Spinner) Draw(ctx *ui.Context) {
 	ctx.Printf(col, 0, tcell.StyleDefault, "%s", frames[cur])
 }
 
-func (s *Spinner) OnInvalidate(onInvalidate func(d ui.Drawable)) {
-	s.onInvalidate = onInvalidate
-}
-
 func (s *Spinner) Invalidate() {
-	if s.onInvalidate != nil {
-		s.onInvalidate(s)
-	}
+	s.DoInvalidate(s)
 }