aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/account.go
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2019-03-14 21:37:00 -0400
committerDrew DeVault <sir@cmpwn.com>2019-03-14 21:37:00 -0400
commit0f8b7a1203309ebec0dc78baf3f195671eadac2d (patch)
treefce6d8148cdbfa5ecfb2030a902f5a0763bb3643 /widgets/account.go
parentb3896476a0e6978c0d7f6fedfb64588934a78f1e (diff)
downloadaerc-0f8b7a1203309ebec0dc78baf3f195671eadac2d.tar.gz
Lay out message list widget basic design
Diffstat (limited to 'widgets/account.go')
-rw-r--r--widgets/account.go11
1 files changed, 7 insertions, 4 deletions
diff --git a/widgets/account.go b/widgets/account.go
index 3085d271..88575354 100644
--- a/widgets/account.go
+++ b/widgets/account.go
@@ -21,6 +21,7 @@ type AccountView struct {
interactive ui.Interactive
onInvalidate func(d ui.Drawable)
runCmd func(cmd string) error
+ msglist *MessageList
msgStores map[string]*MessageStore
statusline *StatusLine
statusbar *ui.Stack
@@ -41,9 +42,6 @@ func NewAccountView(conf *config.AccountConfig,
{ui.SIZE_EXACT, 20},
{ui.SIZE_WEIGHT, 1},
})
- spinner := NewSpinner()
- spinner.Start()
- grid.AddChild(spinner).At(0, 1)
grid.AddChild(statusbar).At(1, 1)
worker, err := worker.NewWorker(conf.Source, logger)
@@ -60,11 +58,15 @@ func NewAccountView(conf *config.AccountConfig,
dirlist := NewDirectoryList(conf, logger, worker)
grid.AddChild(ui.NewBordered(dirlist, ui.BORDER_RIGHT)).Span(2, 1)
+ msglist := NewMessageList(logger, worker)
+ grid.AddChild(msglist).At(0, 1)
+
acct := &AccountView{
conf: conf,
dirlist: dirlist,
grid: grid,
logger: logger,
+ msglist: msglist,
msgStores: make(map[string]*MessageStore),
runCmd: runCmd,
statusbar: statusbar,
@@ -173,7 +175,8 @@ func (acct *AccountView) onMessage(msg types.WorkerMessage) {
case *types.OpenDirectory:
acct.worker.PostAction(&types.FetchDirectoryContents{},
func(msg types.WorkerMessage) {
- // TODO: Do we care
+ store := acct.msgStores[acct.dirlist.selected]
+ acct.msglist.SetStore(store)
})
}
case *types.DirectoryInfo: