From 3d529aa09330f383298a5735a18549b44bc3098f Mon Sep 17 00:00:00 2001 From: Johannes Thyssen Tishman Date: Tue, 26 Mar 2024 23:00:50 +0100 Subject: config: make popover dialogs configurable Add the [ui].dialog-{position,width,height} options in aerc.conf to set the position, width and height of popover dialogs such as the one from :menu, :envelope or :attach -m relative to the main window. Changelog-added: Add `[ui].dialog-{position,width,height}` to set the position, width and height of popover dialogs. Signed-off-by: Johannes Thyssen Tishman Reviewed-by: Tim Culverhouse Acked-by: Robin Jarry --- app/aerc.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'app/aerc.go') diff --git a/app/aerc.go b/app/aerc.go index 97604b17..7418e979 100644 --- a/app/aerc.go +++ b/app/aerc.go @@ -188,10 +188,11 @@ func (aerc *Aerc) Draw(ctx *ui.Context) { if aerc.dialog != nil { if w, h := ctx.Width(), ctx.Height(); w > 8 && h > 4 { if d, ok := aerc.dialog.(Dialog); ok { - start, height := d.ContextHeight() + xstart, width := d.ContextWidth() + ystart, height := d.ContextHeight() aerc.dialog.Draw( - ctx.Subcontext(4, start(h), - w-8, height(h))) + ctx.Subcontext(xstart(w), ystart(h), + width(w), height(h))) } else { aerc.dialog.Draw(ctx.Subcontext(4, h/2-2, w-8, 4)) } -- cgit