diff options
author | Joe <rbo@gmx.us> | 2024-01-08 20:20:20 +0100 |
---|---|---|
committer | Joe <rbo@gmx.us> | 2024-01-08 20:20:20 +0100 |
commit | 4f42a45b5d0454cd1ca5cae2e7ed897bd63f708e (patch) | |
tree | 42a8fccdc094212485ca682340d9229e407cd12d /i_ui.go | |
parent | tmp (diff) | |
download | hardflip-4f42a45b5d0454cd1ca5cae2e7ed897bd63f708e.tar.gz hardflip-4f42a45b5d0454cd1ca5cae2e7ed897bd63f708e.tar.bz2 hardflip-4f42a45b5d0454cd1ca5cae2e7ed897bd63f708e.tar.xz hardflip-4f42a45b5d0454cd1ca5cae2e7ed897bd63f708e.tar.zst hardflip-4f42a45b5d0454cd1ca5cae2e7ed897bd63f708e.zip |
fix
Diffstat (limited to '')
-rw-r--r-- | i_ui.go | 51 |
1 files changed, 29 insertions, 22 deletions
@@ -165,7 +165,7 @@ func i_draw_delete_box(ui HardUI, item *ItemsNode) { } host := item.Host text := "Really delete this host?" - file := host.Dir + host.Filename + file := host.Parent.path() + host.Filename max_len := len(text) if max_len < len(file) { @@ -206,17 +206,20 @@ func i_draw_delete_box(ui HardUI, item *ItemsNode) { } top = ui.dim[H] / 2 + 1 i_draw_text(ui.s, + left - 1, top, right, top, + ui.def_style, "[") + i_draw_text(ui.s, left, top, right, top, ui.def_style.Bold(true).Underline(true), "y") i_draw_text(ui.s, left + 1, top, right, top, - ui.def_style, "es | ") + ui.def_style, "es] [") i_draw_text(ui.s, left + 6, top, right, top, ui.def_style.Bold(true).Underline(true), "n") i_draw_text(ui.s, left + 7, top, right, top, - ui.def_style, "o") + ui.def_style, "o]") } func i_host_panel_dirs(ui HardUI, icons bool, @@ -250,27 +253,30 @@ func i_host_panel_dirs(ui HardUI, icons bool, } func i_host_panel_host(ui HardUI, icons bool, - depth uint16, host *HostNode, curr *HostNode, line int) { + depth uint16, host *HostNode, curr *HostNode, ptr *ItemsNode, line int) { style := ui.def_style if host == curr { - style = style.Reverse(true) - } - text := "" - for i := 0; i < int(depth) - 2; i++ { - text += " " - } - if icons == true { - text += HOST_ICONS[int(host.Protocol)] - } - text += host.Name - spaces := "" - for i := 0; i < (ui.dim[W] / 3) - len(text) + 1; i++ { - spaces += " " - } - text += spaces - i_draw_text(ui.s, - 1, line, ui.dim[W] / 3, line, - style, text) + style = style.Reverse(true) + } + text := "" + for i := 0; i < int(depth) - 2; i++ { + text += " " + } + if icons == true { + text += HOST_ICONS[int(host.Protocol)] + } + text += host.Name + spaces := "" + for i := 0; i < (ui.dim[W] / 3) - len(text) + 1; i++ { + spaces += " " + } + text += spaces + i_draw_text(ui.s, + 1, line, ui.dim[W] / 3, line, + style, text) + i_draw_text(ui.s, + 1, line, ui.dim[W] / 3, line, + style, strconv.Itoa(ptr.ID)) } func i_host_panel(ui HardUI, icons bool, litems *ItemsList) { @@ -286,6 +292,7 @@ func i_host_panel(ui HardUI, icons bool, litems *ItemsList) { ptr.Host.Parent.Depth, ptr.Host, litems.curr.Host, + ptr, line) } else { i_host_panel_dirs(ui, icons, |