~rjarry/aerc-devel

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
3 3

[PATCH aerc] selector: fix body text truncation

Details
Message ID
<20240605064147.51852-2-robin@jarry.cc>
DKIM signature
pass
Download raw message
Patch: +12 -0
When the selector dialog body text contains multiple lines, its height
is adjusted automatically. Since commit 3d529aa09330 ("config: make
popover dialogs configurable"), all text after the first line is
truncated.

This happens because SelectorDialog no longer satisfies the Dialog
interface which got an extra ContextWidth() method.

Implement that method using the full width. The [ui].dialog-* settings
are ignored as they were before for that dialog.

Fixes: 3d529aa09330 ("config: make popover dialogs configurable")
Signed-off-by: Robin Jarry <robin@jarry.cc>
---
 app/selector.go | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/app/selector.go b/app/selector.go
index 252616f05486..705021f8b4d5 100644
--- a/app/selector.go
+++ b/app/selector.go
@@ -214,6 +214,18 @@ func (gp *SelectorDialog) Draw(ctx *ui.Context) {
	gp.selector.Draw(ctx.Subcontext(1, ctx.Height()-1, ctx.Width()-2, 1))
}

func (gp *SelectorDialog) ContextWidth() (func(int) int, func(int) int) {
	// horizontal starting position in columns from the left
	start := func(int) int {
		return 4
	}
	// dialog width from the starting column
	width := func(w int) int {
		return w - 8
	}
	return start, width
}

func (gp *SelectorDialog) ContextHeight() (func(int) int, func(int) int) {
	totalHeight := 2 // title + empty line
	totalHeight += strings.Count(gp.prompt, "\n") + 1
-- 
2.45.1

[aerc/patches] build success

builds.sr.ht <builds@sr.ht>
Details
Message ID
<D1RVP7J8BQA8.MT3XBP2XESSN@fra02>
In-Reply-To
<20240605064147.51852-2-robin@jarry.cc> (view parent)
DKIM signature
missing
Download raw message
aerc/patches: SUCCESS in 1m57s

[selector: fix body text truncation][0] from [Robin Jarry][1]

[0]: https://lists.sr.ht/~rjarry/aerc-devel/patches/53140
[1]: robin@jarry.cc

✓ #1242633 SUCCESS aerc/patches/alpine-edge.yml https://builds.sr.ht/~rjarry/job/1242633
✓ #1242634 SUCCESS aerc/patches/openbsd.yml     https://builds.sr.ht/~rjarry/job/1242634
Johannes Thyssen Tishman <johannes@thyssentishman.com>
Details
Message ID
<D1S81YXRJIEK.WQS17HYXPFMC@thyssentishman.com>
In-Reply-To
<20240605064147.51852-2-robin@jarry.cc> (view parent)
DKIM signature
pass
Download raw message
2024-06-05T06:41:48Z "Robin Jarry" <robin@jarry.cc>:
> When the selector dialog body text contains multiple lines, its height
> is adjusted automatically. Since commit 3d529aa09330 ("config: make
> popover dialogs configurable"), all text after the first line is
> truncated.
>
> This happens because SelectorDialog no longer satisfies the Dialog
> interface which got an extra ContextWidth() method.
>
> Implement that method using the full width. The [ui].dialog-* settings
> are ignored as they were before for that dialog.
>
> Fixes: 3d529aa09330 ("config: make popover dialogs configurable")
> Signed-off-by: Robin Jarry <robin@jarry.cc>

Tested-by: "Johannes Thyssen Tishman" <johannes@thyssentishman.com>
Details
Message ID
<D21G7TVRD953.86T92F8F4W4P@ringo>
In-Reply-To
<D1S81YXRJIEK.WQS17HYXPFMC@thyssentishman.com> (view parent)
DKIM signature
pass
Download raw message
Johannes Thyssen Tishman, Jun 05, 2024 at 18:25:
> 2024-06-05T06:41:48Z "Robin Jarry" <robin@jarry.cc>:
> > When the selector dialog body text contains multiple lines, its height
> > is adjusted automatically. Since commit 3d529aa09330 ("config: make
> > popover dialogs configurable"), all text after the first line is
> > truncated.
> >
> > This happens because SelectorDialog no longer satisfies the Dialog
> > interface which got an extra ContextWidth() method.
> >
> > Implement that method using the full width. The [ui].dialog-* settings
> > are ignored as they were before for that dialog.
> >
> > Fixes: 3d529aa09330 ("config: make popover dialogs configurable")
> > Signed-off-by: Robin Jarry <robin@jarry.cc>
>
> Tested-by: "Johannes Thyssen Tishman" <johannes@thyssentishman.com>

Applied. Thanks!
Reply to thread Export thread (mbox)