diff options
author | Joe <rbo@gmx.us> | 2024-02-27 20:20:20 +0100 |
---|---|---|
committer | Joe <rbo@gmx.us> | 2024-02-27 20:20:20 +0100 |
commit | 754383f818865524bc529dfc175b7b5b080cf6e2 (patch) | |
tree | 20a8db71147b8178a1a012d2af004abed4c696ff /src/i_insert.go | |
parent | tmp (diff) | |
download | hardflip-754383f818865524bc529dfc175b7b5b080cf6e2.tar.gz hardflip-754383f818865524bc529dfc175b7b5b080cf6e2.tar.bz2 hardflip-754383f818865524bc529dfc175b7b5b080cf6e2.tar.xz hardflip-754383f818865524bc529dfc175b7b5b080cf6e2.tar.zst hardflip-754383f818865524bc529dfc175b7b5b080cf6e2.zip |
ye
Diffstat (limited to 'src/i_insert.go')
-rw-r--r-- | src/i_insert.go | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/src/i_insert.go b/src/i_insert.go index 321ac25..5b246aa 100644 --- a/src/i_insert.go +++ b/src/i_insert.go @@ -43,7 +43,7 @@ * POSSIBILITY OF SUCH DAMAGE. * * hardflip: src/i_insert.go - * Fri Feb 23 16:01:46 2024 + * Tue Feb 27 13:48:05 2024 * Joe * * insert a new host @@ -51,11 +51,25 @@ package main -func i_draw_text_box(ui HardUI, line int, label, content string) { - i_draw_text(ui.s, ui.dim[W] / 2 - len(label) - 1, line, ui.dim[W] / 2, line, ) +import "github.com/gdamore/tcell/v2" + +func i_draw_text_box(ui HardUI, line int, dim Quad, label, content string) { + const tbox_size int = 14 + + l := ui.dim[W] / 2 - len(label) - 1 + if l <= dim.L { l = dim.L + 1 } + i_draw_text(ui.s, l, line, ui.dim[W] / 2, line, + ui.style[STYLE_DEF], label) // TODO: here - // i_draw_box(ui.s, ) + spaces := "" + for i := 0; i < tbox_size; i++ { + spaces += " " + } + i_draw_text(ui.s, ui.dim[W] / 2, line, dim.R, line, + ui.style[STYLE_DEF].Background(tcell.ColorBlack).Dim(true), + "|" + spaces + "|") } + func i_draw_insert_panel(ui HardUI, in *HostNode) { if len(in.Name) == 0 { return @@ -69,4 +83,5 @@ func i_draw_insert_panel(ui HardUI, in *HostNode) { i_draw_box(ui.s, win.L, win.T, win.R, win.B, ui.style[STYLE_BOX], ui.style[STYLE_HEAD], " Insert - " + in.Name + " ", true) + i_draw_text_box(ui, win.T + 2, win, "Connection type", "fuck this") } |