summaryrefslogtreecommitdiffstats
path: root/tui/utils.go
diff options
context:
space:
mode:
authorDaniel Milde <daniel@milde.cz>2024-02-13 00:57:03 +0100
committerDaniel Milde <daniel@milde.cz>2024-02-13 23:32:27 +0100
commit9d10101b8ea19bc6a26c61d1bc596bdcfc3a5c9d (patch)
tree7c69210b427c445795566721da7bac15962a4d0f /tui/utils.go
parent4fbb06ec6e312c48c6456e36ee413141fac2caf4 (diff)
feat: export with dialog for file name
Diffstat (limited to 'tui/utils.go')
-rw-r--r--tui/utils.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/tui/utils.go b/tui/utils.go
index f38aa33..351f679 100644
--- a/tui/utils.go
+++ b/tui/utils.go
@@ -2,6 +2,7 @@ package tui
import (
"github.com/dundee/gdu/v5/pkg/device"
+ "github.com/rivo/tview"
)
var (
@@ -65,3 +66,13 @@ func min(a, b int) int {
}
return b
}
+
+func modal(p tview.Primitive, width, height int) tview.Primitive {
+ return tview.NewFlex().
+ AddItem(nil, 0, 1, false).
+ AddItem(tview.NewFlex().SetDirection(tview.FlexRow).
+ AddItem(nil, 0, 1, false).
+ AddItem(p, height, 1, true).
+ AddItem(nil, 0, 1, false), width, 1, true).
+ AddItem(nil, 0, 1, false)
+}