diff options
author | Drew DeVault <sir@cmpwn.com> | 2019-06-02 10:23:53 -0400 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2019-06-02 10:23:53 -0400 |
commit | 7d1770754ff432b0c6f153c066e4c749683b563f (patch) | |
tree | 835b24605288cd1c7ac6f011bb0cbfd0a7cb86a9 /widgets/msgviewer.go | |
parent | 753adb90692e4821f8caea1d5d86cd69e312efa7 (diff) | |
download | aerc-7d1770754ff432b0c6f153c066e4c749683b563f.tar.gz |
Add date to message viewer
Diffstat (limited to 'widgets/msgviewer.go')
-rw-r--r-- | widgets/msgviewer.go | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/widgets/msgviewer.go b/widgets/msgviewer.go index 9230ba3..45a5ed0 100644 --- a/widgets/msgviewer.go +++ b/widgets/msgviewer.go @@ -60,7 +60,7 @@ func NewMessageViewer(acct *AccountView, conf *config.AercConfig, store *lib.MessageStore, msg *types.MessageInfo) *MessageViewer { grid := ui.NewGrid().Rows([]ui.GridSpec{ - {ui.SIZE_EXACT, 3}, // TODO: Based on number of header rows + {ui.SIZE_EXACT, 4}, // TODO: Based on number of header rows {ui.SIZE_WEIGHT, 1}, }).Columns([]ui.GridSpec{ {ui.SIZE_WEIGHT, 1}, @@ -71,6 +71,7 @@ func NewMessageViewer(acct *AccountView, conf *config.AercConfig, {ui.SIZE_EXACT, 1}, {ui.SIZE_EXACT, 1}, {ui.SIZE_EXACT, 1}, + {ui.SIZE_EXACT, 1}, }).Columns([]ui.GridSpec{ {ui.SIZE_WEIGHT, 1}, {ui.SIZE_WEIGHT, 1}, @@ -87,10 +88,15 @@ func NewMessageViewer(acct *AccountView, conf *config.AercConfig, }).At(0, 1) headers.AddChild( &HeaderView{ + Name: "Date", + Value: msg.Envelope.Date.Format("Mon Jan 2, 2006 at 3:04 PM"), + }).At(1, 0).Span(1, 2) + headers.AddChild( + &HeaderView{ Name: "Subject", Value: msg.Envelope.Subject, - }).At(1, 0).Span(1, 2) - headers.AddChild(ui.NewFill(' ')).At(2, 0).Span(1, 2) + }).At(2, 0).Span(1, 2) + headers.AddChild(ui.NewFill(' ')).At(3, 0).Span(1, 2) var err error switcher := &PartSwitcher{} |