diff options
author | Tim Culverhouse <tim@timculverhouse.com> | 2022-10-07 11:00:31 -0500 |
---|---|---|
committer | Robin Jarry <robin@jarry.cc> | 2022-10-12 22:16:40 +0200 |
commit | ba24e92062f1a9b38065d503fd1dde749c27a56c (patch) | |
tree | d1a2981f8f9bda50a070b50c688388fe2130f770 /widgets/selector.go | |
parent | 34014d3ceeebe8a9c131213fa56d1977fbc26b4a (diff) | |
download | aerc-ba24e92062f1a9b38065d503fd1dde749c27a56c.tar.gz |
invalidatable: cleanup dead code
Remove invalidatable type and all associated calls. All items can
directly invalidate the UI.
Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
Acked-by: Robin Jarry <robin@jarry.cc>
Diffstat (limited to 'widgets/selector.go')
-rw-r--r-- | widgets/selector.go | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/widgets/selector.go b/widgets/selector.go index 8a1a1623..66dfb8b5 100644 --- a/widgets/selector.go +++ b/widgets/selector.go @@ -11,7 +11,6 @@ import ( ) type Selector struct { - ui.Invalidatable chooser bool focused bool focus int @@ -36,7 +35,7 @@ func (sel *Selector) Chooser(chooser bool) *Selector { } func (sel *Selector) Invalidate() { - sel.DoInvalidate(sel) + ui.Invalidate() } func (sel *Selector) Draw(ctx *ui.Context) { @@ -166,7 +165,6 @@ func (sel *Selector) Event(event tcell.Event) bool { var ErrNoOptionSelected = fmt.Errorf("no option selected") type SelectorDialog struct { - ui.Invalidatable callback func(string, error) title string prompt string @@ -184,9 +182,6 @@ func NewSelectorDialog(title string, prompt string, options []string, focus int, uiConfig: uiConfig, selector: NewSelector(options, focus, uiConfig).Chooser(true), } - sd.selector.OnInvalidate(func(_ ui.Drawable) { - sd.Invalidate() - }) sd.selector.Focus(true) return sd } @@ -203,7 +198,7 @@ func (gp *SelectorDialog) Draw(ctx *ui.Context) { } func (gp *SelectorDialog) Invalidate() { - gp.DoInvalidate(gp) + ui.Invalidate() } func (gp *SelectorDialog) Event(event tcell.Event) bool { |