From 1c41b63f08d9b46ed558b0b3470cd2a2a9dfaf97 Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Mon, 11 Jun 2018 19:23:09 -0400 Subject: Move sidebar into account tabs This is accomplished through a bit of a hack, the statusbar is able to be a child of multiple dudes --- lib/ui/stack.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lib') diff --git a/lib/ui/stack.go b/lib/ui/stack.go index 3c66f5a..2b97e78 100644 --- a/lib/ui/stack.go +++ b/lib/ui/stack.go @@ -8,7 +8,7 @@ import ( type Stack struct { children []Drawable - onInvalidate func(d Drawable) + onInvalidate []func(d Drawable) } func NewStack() *Stack { @@ -16,12 +16,12 @@ func NewStack() *Stack { } func (stack *Stack) OnInvalidate(onInvalidate func (d Drawable)) { - stack.onInvalidate = onInvalidate + stack.onInvalidate = append(stack.onInvalidate, onInvalidate) } func (stack *Stack) Invalidate() { - if stack.onInvalidate != nil { - stack.onInvalidate(stack) + for _, fn := range stack.onInvalidate { + fn(stack) } } -- cgit v1.2.3