summary refs log tree commit diff stats
path: root/widgets/dirlist.go
diff options
context:
space:
mode:
Diffstat (limited to 'widgets/dirlist.go')
-rw-r--r--widgets/dirlist.go10
1 files changed, 2 insertions, 8 deletions
diff --git a/widgets/dirlist.go b/widgets/dirlist.go
index eb79bc4..374d142 100644
--- a/widgets/dirlist.go
+++ b/widgets/dirlist.go
@@ -12,10 +12,10 @@ import (
 )
 
 type DirectoryList struct {
+	ui.Invalidatable
 	conf         *config.AccountConfig
 	dirs         []string
 	logger       *log.Logger
-	onInvalidate func(d ui.Drawable)
 	selecting    string
 	selected     string
 	spinner      *Spinner
@@ -77,14 +77,8 @@ func (dirlist *DirectoryList) Selected() string {
 	return dirlist.selected
 }
 
-func (dirlist *DirectoryList) OnInvalidate(onInvalidate func(d ui.Drawable)) {
-	dirlist.onInvalidate = onInvalidate
-}
-
 func (dirlist *DirectoryList) Invalidate() {
-	if dirlist.onInvalidate != nil {
-		dirlist.onInvalidate(dirlist)
-	}
+	dirlist.DoInvalidate(dirlist)
 }
 
 func (dirlist *DirectoryList) Draw(ctx *ui.Context) {