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 --- commands/compose/attach.go | 2 +- commands/msg/envelope.go | 17 +---------------- commands/patch/list.go | 2 +- commands/patch/rebase.go | 2 +- 4 files changed, 4 insertions(+), 19 deletions(-) (limited to 'commands') diff --git a/commands/compose/attach.go b/commands/compose/attach.go index 2cf43e80..c86b0f4f 100644 --- a/commands/compose/attach.go +++ b/commands/compose/attach.go @@ -177,7 +177,7 @@ func (a Attach) openMenu() error { } } - app.AddDialog(app.LargeDialog( + app.AddDialog(app.DefaultDialog( ui.NewBox(t, "File Picker", "", app.SelectedAccountUiConfig()), )) diff --git a/commands/msg/envelope.go b/commands/msg/envelope.go index 9b168fae..35243509 100644 --- a/commands/msg/envelope.go +++ b/commands/msg/envelope.go @@ -57,8 +57,7 @@ func (e Envelope) Execute(args []string) error { } } - n := len(list) - app.AddDialog(app.NewDialog( + app.AddDialog(app.DefaultDialog( app.NewListBox( "Message Envelope. Press or to close. "+ "Start typing to filter.", @@ -68,20 +67,6 @@ func (e Envelope) Execute(args []string) error { app.CloseDialog() }, ), - // start pos on screen - func(h int) int { - if n < h/8*6 { - return h/2 - n/2 - 1 - } - return h / 8 - }, - // dialog height - func(h int) int { - if n < h/8*6 { - return n + 2 - } - return h / 8 * 6 - }, )) return nil diff --git a/commands/patch/list.go b/commands/patch/list.go index e73cea3a..0451605b 100644 --- a/commands/patch/list.go +++ b/commands/patch/list.go @@ -88,7 +88,7 @@ func (l List) Execute(args []string) error { ) } - app.AddDialog(app.LargeDialog( + app.AddDialog(app.DefaultDialog( ui.NewBox(viewer, "Patch Management", "", app.SelectedAccountUiConfig(), ), diff --git a/commands/patch/rebase.go b/commands/patch/rebase.go index 45136935..e99cc275 100644 --- a/commands/patch/rebase.go +++ b/commands/patch/rebase.go @@ -117,7 +117,7 @@ func (r Rebase) Execute(args []string) error { return err } - app.AddDialog(app.LargeDialog( + app.AddDialog(app.DefaultDialog( ui.NewBox(viewer, fmt.Sprintf("Patch Rebase on %-6.6s", baseID), "", app.SelectedAccountUiConfig(), ), -- cgit