aboutsummaryrefslogtreecommitdiffstats
path: root/commands/patch
diff options
context:
space:
mode:
authorKoni Marti <koni.marti@gmail.com>2024-01-28 02:08:26 +0100
committerRobin Jarry <robin@jarry.cc>2024-01-29 22:46:08 +0100
commit5719041eb9b846c7d056952e9e14295c65a8b81a (patch)
treebb8972453befd91fdb7b615456c74509ef82868c /commands/patch
parent37b05d7e73b11610f2979abdbe821366e55ee651 (diff)
downloadaerc-5719041eb9b846c7d056952e9e14295c65a8b81a.tar.gz
app: define two dialog constructors
Define two new constructor functions for the popup dialog. DefaultDialog() creates a dialog that spans half of the screen, whereas the LargeDialog() covers three-quarter of the screen. If a dialog widget has more specific size requirements, custom window position and window height functions can be used with NewDialog(). Signed-off-by: Koni Marti <koni.marti@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
Diffstat (limited to 'commands/patch')
-rw-r--r--commands/patch/list.go10
-rw-r--r--commands/patch/rebase.go10
2 files changed, 2 insertions, 18 deletions
diff --git a/commands/patch/list.go b/commands/patch/list.go
index 73461f2e..ee2850c3 100644
--- a/commands/patch/list.go
+++ b/commands/patch/list.go
@@ -88,18 +88,10 @@ func (l List) Execute(args []string) error {
)
}
- app.AddDialog(app.NewDialog(
+ app.AddDialog(app.LargeDialog(
ui.NewBox(viewer, "Patch Management", "",
app.SelectedAccountUiConfig(),
),
- // start pos on screen
- func(h int) int {
- return h / 8
- },
- // dialog height
- func(h int) int {
- return h - 2*h/8
- },
))
return nil
diff --git a/commands/patch/rebase.go b/commands/patch/rebase.go
index 6ef43299..65aa580a 100644
--- a/commands/patch/rebase.go
+++ b/commands/patch/rebase.go
@@ -117,18 +117,10 @@ func (r Rebase) Execute(args []string) error {
return err
}
- app.AddDialog(app.NewDialog(
+ app.AddDialog(app.LargeDialog(
ui.NewBox(viewer, fmt.Sprintf("Patch Rebase on %-6.6s", baseID), "",
app.SelectedAccountUiConfig(),
),
- // start pos on screen
- func(h int) int {
- return h / 8
- },
- // dialog height
- func(h int) int {
- return h - 2*h/8
- },
))
return nil