diff options
author | Drew DeVault <sir@cmpwn.com> | 2018-01-10 22:41:15 -0500 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2018-01-10 22:41:15 -0500 |
commit | 77a0f68758905faa74407499ff92c90929e27989 (patch) | |
tree | 44edc8d2de572deff60330f609aecab56aa4dea7 /ui/account.go | |
parent | db1b2cd53f5dc7bfbfb6ee54ad0bb0882ea2cc03 (diff) | |
download | aerc-77a0f68758905faa74407499ff92c90929e27989.tar.gz |
Make termbox event loop async
Diffstat (limited to 'ui/account.go')
-rw-r--r-- | ui/account.go | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/ui/account.go b/ui/account.go new file mode 100644 index 0000000..0949e52 --- /dev/null +++ b/ui/account.go @@ -0,0 +1,41 @@ +package ui + +import ( + tb "github.com/nsf/termbox-go" + + "git.sr.ht/~sircmpwn/aerc2/config" + "git.sr.ht/~sircmpwn/aerc2/worker" +) + +type AccountTab struct { + Config *config.AccountConfig + Worker *worker.Worker + Parent *UIState +} + +func NewAccountTab(conf *config.AccountConfig, work *worker.Worker) *AccountTab { + return &AccountTab{ + Config: conf, + Worker: work, + } +} + +func (acc *AccountTab) Name() string { + return acc.Config.Name +} + +func (acc *AccountTab) Invalid() bool { + return false +} + +func (acc *AccountTab) SetParent(parent *UIState) { + acc.Parent = parent +} + +func (acc *AccountTab) Render(at Geometry) { + cell := tb.Cell{ + Fg: tb.ColorDefault, + Bg: tb.ColorDefault, + } + TPrintf(&at, cell, "%s", acc.Name()) +} |