diff options
author | Joe <rbo@gmx.us> | 2024-01-18 20:20:20 +0100 |
---|---|---|
committer | Joe <rbo@gmx.us> | 2024-01-18 20:20:20 +0100 |
commit | 0776a238c4c10a35b39160f37271bc8b5cd026b0 (patch) | |
tree | 6b4322126460d414ed7f113b47a1d2331abc8bf8 /i_ui.go | |
parent | good (diff) | |
download | hardflip-0776a238c4c10a35b39160f37271bc8b5cd026b0.tar.gz hardflip-0776a238c4c10a35b39160f37271bc8b5cd026b0.tar.bz2 hardflip-0776a238c4c10a35b39160f37271bc8b5cd026b0.tar.xz hardflip-0776a238c4c10a35b39160f37271bc8b5cd026b0.tar.zst hardflip-0776a238c4c10a35b39160f37271bc8b5cd026b0.zip |
split
Diffstat (limited to '')
-rw-r--r-- | i_ui.go | 18 |
1 files changed, 12 insertions, 6 deletions
@@ -489,7 +489,7 @@ func i_info_panel_host(ui HardUI, host *HostNode) { } } -func i_info_panel(ui HardUI, litems *ItemsList) { +func i_info_panel(ui HardUI, percent bool, litems *ItemsList) { i_draw_box(ui.s, (ui.dim[W] / 3), 0, ui.dim[W] - 1, ui.dim[H] - 2, " Infos ", false) @@ -500,6 +500,10 @@ func i_info_panel(ui HardUI, litems *ItemsList) { if litems.head != nil { text := " " + strconv.Itoa(litems.curr.ID) + " of " + strconv.Itoa(int(litems.last.ID)) + " " + if percent == true { + text += "- " + + strconv.Itoa(litems.curr.ID * 100 / litems.last.ID) + "% " + } i_draw_text(ui.s, (ui.dim[W] - 1) - len(text) - 1, ui.dim[H] - 2, @@ -507,6 +511,7 @@ func i_info_panel(ui HardUI, litems *ItemsList) { ui.dim[H] - 2, ui.def_style, text) + i_draw_text(ui.s, 0, ui.dim[H] - 2, len(text), ui.dim[H] - 2, ui.def_style, text) } else { text := " 0 hosts " i_draw_text(ui.s, @@ -536,13 +541,14 @@ func i_scrollhint(ui HardUI, litems *ItemsList) { if max <= h { return } - if litems.draw.ID > 1 { - ui.s.SetContent(0, 0, + draw_id := litems.draw.ID + if draw_id > 1 { + ui.s.SetContent(0, 1, '▲', nil, ui.def_style) } - if max - litems.draw.ID > h { - ui.s.SetContent(0, ui.dim[H] - 2, + if max - draw_id > h { + ui.s.SetContent(0, ui.dim[H] - 3, '▼', nil, ui.def_style) return @@ -574,7 +580,7 @@ func i_ui(data *HardData) { ui.s.Clear() i_bottom_text(*ui) i_host_panel(data.ui, data.opts.Icon, data.litems, data) - i_info_panel(data.ui, data.litems) + i_info_panel(data.ui, data.opts.Perc, data.litems) i_scrollhint(data.ui, data.litems) if data.litems.head == nil { i_draw_zhosts_box(*ui) |