diff options
author | Joe <rbo@gmx.us> | 2024-01-19 20:20:20 +0100 |
---|---|---|
committer | Joe <rbo@gmx.us> | 2024-01-19 20:20:20 +0100 |
commit | 3876a302edba4e160102e88bdd8f35eef63735e0 (patch) | |
tree | 99edc4a6adf3fed16f5a26870ee1414aebdc6a4e | |
parent | go (diff) | |
download | hardflip-3876a302edba4e160102e88bdd8f35eef63735e0.tar.gz hardflip-3876a302edba4e160102e88bdd8f35eef63735e0.tar.bz2 hardflip-3876a302edba4e160102e88bdd8f35eef63735e0.tar.xz hardflip-3876a302edba4e160102e88bdd8f35eef63735e0.tar.zst hardflip-3876a302edba4e160102e88bdd8f35eef63735e0.zip |
ok
-rw-r--r-- | ROADMAP.md | 4 | ||||
-rw-r--r-- | c_init.go | 4 | ||||
-rw-r--r-- | i_host.go | 25 | ||||
-rw-r--r-- | i_info.go | 2 | ||||
-rw-r--r-- | i_ui.go | 38 |
5 files changed, 40 insertions, 33 deletions
@@ -34,6 +34,10 @@ - [ ] theming +## v0.8 + +- [ ] single commands + ## v1.0 - wheelbite - [ ] README.md @@ -81,7 +81,7 @@ func c_recurse_data_dir(dir, root string, opts HardOpts, nil, } ldirs.add_back(&dir_node) - i_display_load_ui(ui) + i_draw_load_ui(ui) for _, file := range files { filename := file.Name() if file.IsDir() == true { @@ -95,7 +95,7 @@ func c_recurse_data_dir(dir, root string, opts HardOpts, host_node.Filename = filename host_node.Parent = &dir_node dir_node.lhost.add_back(host_node) - i_display_load_ui(ui) + i_draw_load_ui(ui) } } } @@ -99,7 +99,7 @@ func i_host_panel_host(ui HardUI, icons bool, style, text) } -func i_host_panel(ui HardUI, icons bool, litems *ItemsList, data *HardData) { +func i_draw_host_panel(ui HardUI, icons bool, litems *ItemsList, data *HardData) { i_draw_box(ui.s, 0, 0, ui.dim[W] / 3, ui.dim[H] - 2, " Hosts ", false) @@ -129,26 +129,3 @@ func i_host_panel(ui HardUI, icons bool, litems *ItemsList, data *HardData) { } } } - -func i_scrollhint(ui HardUI, litems *ItemsList) { - if litems.head == nil { - return - } - h := ui.dim[H] - 4 - max := litems.last.ID - if max <= h { - return - } - draw_id := litems.draw.ID - if draw_id > 1 { - ui.s.SetContent(0, 1, - '▲', - nil, ui.def_style) - } - if max - draw_id > h { - ui.s.SetContent(0, ui.dim[H] - 3, - '▼', - nil, ui.def_style) - return - } -} @@ -297,7 +297,7 @@ func i_info_panel_host(ui HardUI, host *HostNode) { } } -func i_info_panel(ui HardUI, percent bool, litems *ItemsList) { +func i_draw_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) @@ -123,7 +123,7 @@ func i_draw_box(s tcell.Screen, x1, y1, x2, y2 int, title string, fill bool) { i_draw_text(s, x1 + 1, y1, x2 - 1, y1, style, title) } -func i_bottom_text(ui HardUI) { +func i_draw_bottom_text(ui HardUI) { text := "" switch ui.mode { @@ -228,10 +228,36 @@ func i_draw_delete_box(ui HardUI, item *ItemsNode) { ui.def_style, "o]") } +func i_draw_err_box() { +} + +func i_draw_scrollhint(ui HardUI, litems *ItemsList) { + if litems.head == nil { + return + } + h := ui.dim[H] - 4 + max := litems.last.ID + if max <= h { + return + } + draw_id := litems.draw.ID + if draw_id > 1 { + ui.s.SetContent(0, 1, + '▲', + nil, ui.def_style) + } + if max - draw_id > h { + ui.s.SetContent(0, ui.dim[H] - 3, + '▼', + nil, ui.def_style) + return + } +} + // HACK: fuck global vars but do we have the choice really var g_load_count int = -1 -func i_display_load_ui(ui *HardUI) { +func i_draw_load_ui(ui *HardUI) { g_load_count += 1 if g_load_count % 1000 != 0 { return @@ -310,10 +336,10 @@ func i_ui(data_dir string, opts HardOpts) { } for { data.ui.s.Clear() - i_bottom_text(data.ui) - i_host_panel(data.ui, data.opts.Icon, data.litems, &data) - i_info_panel(data.ui, data.opts.Perc, data.litems) - i_scrollhint(data.ui, data.litems) + i_draw_bottom_text(data.ui) + 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) if data.litems.head == nil { i_draw_zhosts_box(data.ui) } |