aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/c_defs.go4
-rw-r--r--src/i_insert.go8
-rw-r--r--src/i_ui.go16
3 files changed, 20 insertions, 8 deletions
diff --git a/src/c_defs.go b/src/c_defs.go
index f7f5efb..f11b93c 100644
--- a/src/c_defs.go
+++ b/src/c_defs.go
@@ -65,8 +65,10 @@ m: mkdir -
!s: search -
[C-r]: reload
!?: help`
- ERROR_KEYS_HINTS = "[Enter]: Ok"
+ ERROR_KEYS_HINTS = "[Enter]: ok"
CONFIRM_KEYS_HINTS = `y/n: yes - no`
+ INSERT_KEYS_HINTS = `[Tab]: next -
+[S-Tab]: prev`
)
const (
diff --git a/src/i_insert.go b/src/i_insert.go
index e6e7b13..321ac25 100644
--- a/src/i_insert.go
+++ b/src/i_insert.go
@@ -43,7 +43,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*
* hardflip: src/i_insert.go
- * Wed Feb 21 19:41:56 2024
+ * Fri Feb 23 16:01:46 2024
* Joe
*
* insert a new host
@@ -51,6 +51,11 @@
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, )
+ // TODO: here
+ // i_draw_box(ui.s, )
+}
func i_draw_insert_panel(ui HardUI, in *HostNode) {
if len(in.Name) == 0 {
return
@@ -64,5 +69,4 @@ 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)
- // TODO: here
}
diff --git a/src/i_ui.go b/src/i_ui.go
index 6d24e6f..15cb24e 100644
--- a/src/i_ui.go
+++ b/src/i_ui.go
@@ -170,7 +170,7 @@ func i_draw_msg(s tcell.Screen, lines int, box_style tcell.Style,
box_style, title)
}
-func i_draw_bottom_text(ui HardUI, opts HardOpts) {
+func i_draw_bottom_text(ui HardUI, opts HardOpts, insert *HostNode) {
text := ""
switch ui.mode {
@@ -183,10 +183,16 @@ func i_draw_bottom_text(ui HardUI, opts HardOpts) {
case ERROR_MODE:
text = ERROR_KEYS_HINTS
case WELCOME_MODE:
- if len(opts.GPG) > 0 {
- text = CONFIRM_KEYS_HINTS
+ if len(opts.GPG) == 0 {
+ text = ""
} else {
+ text = CONFIRM_KEYS_HINTS
+ }
+ case INSERT_MODE:
+ if insert == nil {
text = ""
+ } else {
+ text = INSERT_KEYS_HINTS
}
default:
text = ""
@@ -483,7 +489,7 @@ func i_draw_load_ui(ui *HardUI, opts HardOpts) {
}
i_draw_text(ui.s, 1, ui.dim[H] - 1, ui.dim[W], ui.dim[H] - 1,
ui.style[STYLE_BOT], text)
- i_draw_bottom_text(*ui, opts)
+ i_draw_bottom_text(*ui, opts, nil)
i_draw_msg(ui.s, 1, ui.style[STYLE_BOX], ui.dim, " Loading ")
text = "Loading " + strconv.Itoa(g_load_count) + " hosts"
left, right := i_left_right(len(text), ui)
@@ -582,7 +588,7 @@ func i_ui(data_dir string) {
}
for {
data.ui.s.Clear()
- i_draw_bottom_text(data.ui, data.opts)
+ i_draw_bottom_text(data.ui, data.opts, data.insert)
i_draw_host_panel(data.ui, data.opts.Icon, data.litems, &data)
i_draw_info_panel(data.ui, data.opts.Perc, data.litems)
i_draw_scrollhint(data.ui, data.litems)