aboutsummaryrefslogtreecommitdiff
path: root/commands
diff options
context:
space:
mode:
authorJohannes Thyssen Tishman <johannes@thyssentishman.com>2024-03-26 23:00:50 +0100
committerRobin Jarry <robin@jarry.cc>2024-04-02 22:22:33 +0200
commit3d529aa09330f383298a5735a18549b44bc3098f (patch)
treea075dbdde8c4ecbfda22dc92ce97949a8d6b69b2 /commands
parent1ce82f50d0981a9ee047e75d94c7ab496070bd4a (diff)
downloadaerc-3d529aa09330f383298a5735a18549b44bc3098f.tar.gz
aerc-3d529aa09330f383298a5735a18549b44bc3098f.zip
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 <johannes@thyssentishman.com> Reviewed-by: Tim Culverhouse <tim@timculverhouse.com> Acked-by: Robin Jarry <robin@jarry.cc>
Diffstat (limited to 'commands')
-rw-r--r--commands/compose/attach.go2
-rw-r--r--commands/msg/envelope.go17
-rw-r--r--commands/patch/list.go2
-rw-r--r--commands/patch/rebase.go2
4 files changed, 4 insertions, 19 deletions
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 <Esc> or <Enter> 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(),
),