diff options
author | Moritz Poldrack <git@moritz.sh> | 2022-12-17 22:28:57 +0100 |
---|---|---|
committer | Robin Jarry <robin@jarry.cc> | 2022-12-19 11:29:25 +0100 |
commit | 723ab8d9f373d35f629e1b3c9ec68fa8983aafd4 (patch) | |
tree | d700ba21a80395ae5fc29ff60617ad3753a51a99 | |
parent | 7978c0ea51b3e82e207acaf39c0a6cb52a14961f (diff) | |
download | aerc-723ab8d9f373d35f629e1b3c9ec68fa8983aafd4.tar.gz |
msglist: make width available externally
This will be reused in next commit.
Signed-off-by: Moritz Poldrack <git@moritz.sh>
Acked-by: Robin Jarry <robin@jarry.cc>
-rw-r--r-- | widgets/msglist.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/widgets/msglist.go b/widgets/msglist.go index e3f3f14e..842e2911 100644 --- a/widgets/msglist.go +++ b/widgets/msglist.go @@ -22,6 +22,7 @@ import ( type MessageList struct { Scrollable height int + width int nmsgs int spinner *Spinner store *lib.MessageStore @@ -46,6 +47,7 @@ func (ml *MessageList) Invalidate() { func (ml *MessageList) Draw(ctx *ui.Context) { ml.height = ctx.Height() + ml.width = ctx.Width() uiConfig := ml.aerc.SelectedAccountUiConfig() ctx.Fill(0, 0, ctx.Width(), ctx.Height(), ' ', uiConfig.GetStyle(config.STYLE_MSGLIST_DEFAULT)) @@ -338,6 +340,10 @@ func (ml *MessageList) Height() int { return ml.height } +func (ml *MessageList) Width() int { + return ml.width +} + func (ml *MessageList) storeUpdate(store *lib.MessageStore) { if ml.Store() != store { return |