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 | 11d77266303a0229d42238c0cfa4b61628181641 (patch) | |
tree | bfbfb81589cfebf04668dc998785a507972532a3 /i_ui.go | |
parent | movement (diff) | |
download | hardflip-11d77266303a0229d42238c0cfa4b61628181641.tar.gz hardflip-11d77266303a0229d42238c0cfa4b61628181641.tar.bz2 hardflip-11d77266303a0229d42238c0cfa4b61628181641.tar.xz hardflip-11d77266303a0229d42238c0cfa4b61628181641.tar.zst hardflip-11d77266303a0229d42238c0cfa4b61628181641.zip |
coolio
Diffstat (limited to 'i_ui.go')
-rw-r--r-- | i_ui.go | 15 |
1 files changed, 6 insertions, 9 deletions
@@ -63,7 +63,6 @@ type HardUI struct { list_start int mode uint8 sel_max int - sel_id int count_dirs int count_hosts int def_style tcell.Style @@ -73,17 +72,14 @@ type HardUI struct { } func (ui *HardUI) inc_sel(n int, data *HardData) { - // HACK: ui.sel_id and litems.curr.ID are essentially the same thing - // NOTE: maybe keep only one there, see later if data.litems.curr == nil { return } data.litems.curr = data.litems.curr.inc(n) - ui.sel_id = data.litems.curr.ID - if ui.sel_id > ui.list_start + ui.dim[H] - 4 { - ui.list_start = (ui.sel_id + 1) - (ui.dim[H] + 3) - } else if ui.sel_id < ui.list_start { - ui.list_start = ui.sel_id + if data.litems.curr.ID > ui.list_start + ui.dim[H] - 4 { + ui.list_start = (data.litems.curr.ID + 1) - (ui.dim[H] + 3) + } else if data.litems.curr.ID < ui.list_start { + ui.list_start = data.litems.curr.ID } } @@ -358,7 +354,8 @@ func i_info_panel(ui HardUI, lhost *HostList) { if lhost.head == nil { return } - host = lhost.sel(ui.sel_id) + // HACK: litems instead of this mess + // host = lhost.sel(ui.sel_id) host_type = host.protocol_str() // name, type i_draw_text(ui.s, |