diff options
author | Drew DeVault <sir@cmpwn.com> | 2020-05-05 09:57:19 -0400 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2020-05-05 09:57:29 -0400 |
commit | 52eb38ae5d8e56e96db4bd7ee31159efd4c5d241 (patch) | |
tree | 50980353b025b60809c0ead37f05f7d9249d1363 /lib/ui/ui.go | |
parent | 866cd17dd7d760e2653686c1c31c96dee58d09bc (diff) | |
download | aerc-52eb38ae5d8e56e96db4bd7ee31159efd4c5d241.tar.gz |
libui: don't require beeper for main content
Diffstat (limited to 'lib/ui/ui.go')
-rw-r--r-- | lib/ui/ui.go | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/ui/ui.go b/lib/ui/ui.go index 9a9ed14..ee71f8e 100644 --- a/lib/ui/ui.go +++ b/lib/ui/ui.go @@ -17,7 +17,7 @@ type UI struct { invalid int32 // access via atomic } -func Initialize(content DrawableInteractiveBeeper) (*UI, error) { +func Initialize(content DrawableInteractive) (*UI, error) { screen, err := tcell.NewScreen() if err != nil { @@ -52,7 +52,9 @@ func Initialize(content DrawableInteractiveBeeper) (*UI, error) { content.OnInvalidate(func(_ Drawable) { atomic.StoreInt32(&state.invalid, 1) }) - content.OnBeep(screen.Beep) + if beeper, ok := content.(DrawableInteractiveBeeper); ok { + beeper.OnBeep(screen.Beep) + } content.Focus(true) if root, ok := content.(RootDrawable); ok { |