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/compose.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/compose.go')
-rw-r--r-- | widgets/compose.go | 35 |
1 files changed, 5 insertions, 30 deletions
diff --git a/widgets/compose.go b/widgets/compose.go index 9b8b30cb..06452230 100644 --- a/widgets/compose.go +++ b/widgets/compose.go @@ -127,7 +127,6 @@ func (c *Composer) SwitchAccount(newAcct *AccountView) error { editor.loadValue() } c.Invalidate() - c.aerc.Invalidate() logging.Infof("account sucessfully switched") return nil } @@ -567,13 +566,7 @@ func (c *Composer) Draw(ctx *ui.Context) { } func (c *Composer) Invalidate() { - c.grid.Invalidate() -} - -func (c *Composer) OnInvalidate(fn func(d ui.Drawable)) { - c.grid.OnInvalidate(func(_ ui.Drawable) { - fn(c) - }) + ui.Invalidate() } func (c *Composer) Close() { @@ -1107,7 +1100,7 @@ func extractHumanHeaderValue(key string, h *mail.Header) string { // decoding issues are ignored and return their raw values func (he *headerEditor) loadValue() { he.input.Set(extractHumanHeaderValue(he.name, he.header)) - he.input.Invalidate() + ui.Invalidate() } // storeValue writes the current state back to the underlying header. @@ -1159,13 +1152,7 @@ func (he *headerEditor) MouseEvent(localX int, localY int, event tcell.Event) { } func (he *headerEditor) Invalidate() { - he.input.Invalidate() -} - -func (he *headerEditor) OnInvalidate(fn func(ui.Drawable)) { - he.input.OnInvalidate(func(_ ui.Drawable) { - fn(he) - }) + ui.Invalidate() } func (he *headerEditor) Focus(focused bool) { @@ -1301,13 +1288,7 @@ func newReviewMessage(composer *Composer, err error) *reviewMessage { } func (rm *reviewMessage) Invalidate() { - rm.grid.Invalidate() -} - -func (rm *reviewMessage) OnInvalidate(fn func(ui.Drawable)) { - rm.grid.OnInvalidate(func(_ ui.Drawable) { - fn(rm) - }) + ui.Invalidate() } func (rm *reviewMessage) Draw(ctx *ui.Context) { @@ -1344,13 +1325,7 @@ func (cs *cryptoStatus) Draw(ctx *ui.Context) { } func (cs *cryptoStatus) Invalidate() { - cs.status.Invalidate() -} - -func (cs *cryptoStatus) OnInvalidate(fn func(ui.Drawable)) { - cs.status.OnInvalidate(func(_ ui.Drawable) { - fn(cs) - }) + ui.Invalidate() } func (c *Composer) checkEncryptionKeys(_ string) bool { |