diff options
author | Drew DeVault <sir@cmpwn.com> | 2019-06-02 09:33:41 -0400 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2019-06-02 09:33:41 -0400 |
commit | 7f434850b51c4f47ad2d43d556baf4c91e5e85ca (patch) | |
tree | e2ba26b0bba7120fe646eb5a70aab4f955a59131 | |
parent | cf50b987681d00a37f9457ddfa6f8bffb962af3b (diff) | |
download | aerc-7f434850b51c4f47ad2d43d556baf4c91e5e85ca.zip |
Simplify layout of message viewer grid
This sub-grid was an artifact of an older design
-rw-r--r-- | widgets/msgviewer.go | 20 |
1 files changed, 3 insertions, 17 deletions
diff --git a/widgets/msgviewer.go b/widgets/msgviewer.go index d31e051..cf360bc 100644 --- a/widgets/msgviewer.go +++ b/widgets/msgviewer.go @@ -91,18 +91,7 @@ func NewMessageViewer(conf *config.AercConfig, }).At(1, 0).Span(1, 2) headers.AddChild(ui.NewFill(' ')).At(2, 0).Span(1, 2) - body := ui.NewGrid().Rows([]ui.GridSpec{ - {ui.SIZE_WEIGHT, 1}, - }).Columns([]ui.GridSpec{ - {ui.SIZE_WEIGHT, 1}, - {ui.SIZE_EXACT, 20}, - }) - - var ( - err error - mv *MessageViewer - ) - + var err error switcher := &PartSwitcher{} if len(msg.BodyStructure.Parts) == 0 { pv, err := NewPartViewer(conf, store, msg, msg.BodyStructure, []int{1}) @@ -132,18 +121,15 @@ func NewMessageViewer(conf *config.AercConfig, } grid.AddChild(headers).At(0, 0) - grid.AddChild(body).At(1, 0) + grid.AddChild(switcher).At(1, 0) - mv = &MessageViewer{ + return &MessageViewer{ grid: grid, msg: msg, store: store, switcher: switcher, } - body.AddChild(mv.switcher).At(0, 0).Span(1, 2) - return mv - handle_error: return &MessageViewer{ err: err, |