aboutsummaryrefslogtreecommitdiff
path: root/ui/account.go
blob: 0949e524267f603560cf4571148045982fe179cb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
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())
}