diff options
author | Joe <rbo@gmx.us> | 2024-02-28 20:20:20 +0100 |
---|---|---|
committer | Joe <rbo@gmx.us> | 2024-02-28 20:20:20 +0100 |
commit | 561391d9d0f0608ee0ab0e066a92cf86502e418a (patch) | |
tree | de5ef4d3967278f6a16dfb47e4367529db4175ff /src/i_ui.go | |
parent | gop (diff) | |
download | hardflip-561391d9d0f0608ee0ab0e066a92cf86502e418a.tar.gz hardflip-561391d9d0f0608ee0ab0e066a92cf86502e418a.tar.bz2 hardflip-561391d9d0f0608ee0ab0e066a92cf86502e418a.tar.xz hardflip-561391d9d0f0608ee0ab0e066a92cf86502e418a.tar.zst hardflip-561391d9d0f0608ee0ab0e066a92cf86502e418a.zip |
fuckye
Diffstat (limited to 'src/i_ui.go')
-rw-r--r-- | src/i_ui.go | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/src/i_ui.go b/src/i_ui.go index 043bdca..8e1f3b5 100644 --- a/src/i_ui.go +++ b/src/i_ui.go @@ -376,6 +376,16 @@ func i_prompt_type(ui HardUI) { ui.s.ShowCursor(len(text), ui.dim[H] - 1) } +func i_prompt_generic(ui HardUI, prompt string) { + i_draw_text(ui.s, + 1, ui.dim[H] - 1, ui.dim[W] - 1, ui.dim[H] - 1, + ui.style[STYLE_DEF], prompt) + i_draw_text(ui.s, len(prompt) + 1, + ui.dim[H] - 1, ui.dim[W] - 1, ui.dim[H] - 1, + ui.style[STYLE_DEF].Bold(true), ui.buff) + ui.s.ShowCursor(len(prompt) + 1 + len(ui.buff), ui.dim[H] - 1) +} + func i_prompt_insert(ui HardUI, curr *ItemsNode) { path := "/" if curr != nil { @@ -386,7 +396,7 @@ func i_prompt_insert(ui HardUI, curr *ItemsNode) { } } path = path[1:] - prompt := "name: " + prompt := "Name: " i_draw_text(ui.s, 1, ui.dim[H] - 1, ui.dim[W] - 1, ui.dim[H] - 1, ui.style[STYLE_DEF], prompt) @@ -637,8 +647,13 @@ func i_ui(data_dir string) { } else { i_draw_insert_panel(data.ui, data.insert) if data.ui.insert_sel_ok == true { - if data.ui.insert_sel == 0 { + switch data.ui.insert_sel { + case 0: i_prompt_type(data.ui) + case 1: + i_prompt_generic(data.ui, "Host/IP: ") + case 2: + i_prompt_generic(data.ui, "Port: ") } } } |