aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoe <rbo@gmx.us>2024-01-19 20:20:20 +0100
committerJoe <rbo@gmx.us>2024-01-19 20:20:20 +0100
commit3876a302edba4e160102e88bdd8f35eef63735e0 (patch)
tree99edc4a6adf3fed16f5a26870ee1414aebdc6a4e
parentgo (diff)
downloadhardflip-3876a302edba4e160102e88bdd8f35eef63735e0.tar.gz
hardflip-3876a302edba4e160102e88bdd8f35eef63735e0.tar.bz2
hardflip-3876a302edba4e160102e88bdd8f35eef63735e0.tar.xz
hardflip-3876a302edba4e160102e88bdd8f35eef63735e0.tar.zst
hardflip-3876a302edba4e160102e88bdd8f35eef63735e0.zip
ok
-rw-r--r--ROADMAP.md4
-rw-r--r--c_init.go4
-rw-r--r--i_host.go25
-rw-r--r--i_info.go2
-rw-r--r--i_ui.go38
5 files changed, 40 insertions, 33 deletions
diff --git a/ROADMAP.md b/ROADMAP.md
index f928c46..e9e7afe 100644
--- a/ROADMAP.md
+++ b/ROADMAP.md
@@ -34,6 +34,10 @@
- [ ] theming
+## v0.8
+
+- [ ] single commands
+
## v1.0 - wheelbite
- [ ] README.md
diff --git a/c_init.go b/c_init.go
index 3e7e4d1..6355d94 100644
--- a/c_init.go
+++ b/c_init.go
@@ -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)
}
}
}
diff --git a/i_host.go b/i_host.go
index 46f7d56..bcb39e1 100644
--- a/i_host.go
+++ b/i_host.go
@@ -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
- }
-}
diff --git a/i_info.go b/i_info.go
index 890661f..1b96ec3 100644
--- a/i_info.go
+++ b/i_info.go
@@ -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)
diff --git a/i_ui.go b/i_ui.go
index f6681cb..2126e2a 100644
--- a/i_ui.go
+++ b/i_ui.go
@@ -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)
}