aboutsummaryrefslogtreecommitdiffstats
path: root/i_ui.go
diff options
context:
space:
mode:
authorJoe <rbo@gmx.us>2024-01-15 20:20:20 +0100
committerJoe <rbo@gmx.us>2024-01-15 20:20:20 +0100
commit0d4ed52f7dc666b8ad36519520328aea623ffba1 (patch)
tree4813050c97c7853720fd6f73ae32de23f8ea1f35 /i_ui.go
parentthink its ok (diff)
downloadhardflip-0d4ed52f7dc666b8ad36519520328aea623ffba1.tar.gz
hardflip-0d4ed52f7dc666b8ad36519520328aea623ffba1.tar.bz2
hardflip-0d4ed52f7dc666b8ad36519520328aea623ffba1.tar.xz
hardflip-0d4ed52f7dc666b8ad36519520328aea623ffba1.tar.zst
hardflip-0d4ed52f7dc666b8ad36519520328aea623ffba1.zip
delete boy
Diffstat (limited to 'i_ui.go')
-rw-r--r--i_ui.go9
1 files changed, 5 insertions, 4 deletions
diff --git a/i_ui.go b/i_ui.go
index 608b6a6..2177ce3 100644
--- a/i_ui.go
+++ b/i_ui.go
@@ -281,8 +281,10 @@ func i_host_panel(ui HardUI, icons bool, litems *ItemsList, data *HardData) {
ui.dim[W] / 3, ui.dim[H] - 2,
" Hosts ", false)
line := 1
- ptr := litems.draw
- for ; ptr != nil && line < ui.dim[H] - 2; ptr = ptr.next {
+ if litems.head == nil {
+ return
+ }
+ for ptr := litems.draw; ptr != nil && line < ui.dim[H] - 2; ptr = ptr.next {
if ptr.is_dir() == false && ptr.Host != nil {
i_host_panel_host(ui,
icons,
@@ -303,7 +305,7 @@ func i_host_panel(ui HardUI, icons bool, litems *ItemsList, data *HardData) {
line++
}
}
- if ui.sel_max != 0 {
+ if litems.head == nil {
i_draw_text(ui.s,
1, ui.dim[H] - 2, (ui.dim[W] / 3) - 1, ui.dim[H] - 2,
ui.def_style,
@@ -525,7 +527,6 @@ func i_info_panel(ui HardUI, litems *ItemsList) {
func i_ui(data *HardData) {
var err error
ui := &data.ui
- ui.sel_max = data.litems.last.ID
ui.s, err = tcell.NewScreen()
if err != nil {