From db553a53509678b17ebedbdd93d7a5c5a9e8e5f4 Mon Sep 17 00:00:00 2001 From: Joe Date: Tue, 26 Dec 2023 20:20:20 +0100 Subject: must go --- i_ui.go | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) (limited to 'i_ui.go') diff --git a/i_ui.go b/i_ui.go index 89bb123..dc2b938 100644 --- a/i_ui.go +++ b/i_ui.go @@ -63,6 +63,7 @@ type HardUI struct { count_dirs uint64 count_hosts uint64 def_style tcell.Style + dir_style tcell.Style title_style tcell.Style dim [2]int } @@ -220,17 +221,23 @@ func i_host_panel(ui HardUI, opts HardOpts, ldirs *DirsList) { dirs = dirs.next } for line := 1; line < ui.dim[H] - 2 && dirs != nil; line++ { - style := ui.def_style + if dirs.ID == 0 { + dirs = dirs.next + } + style := ui.dir_style if ui.sel == dirs.ID { - style = ui.def_style.Reverse(true) + style = ui.dir_style.Reverse(true) } text := "" + for i := 0; i < int(dirs.Depth) - 2; i++ { + text += " " + } if opts.Icon == true { var fold_var uint8 if dirs.Folded == true { fold_var = 1 } - text = dirs_icons[fold_var] + text += dirs_icons[fold_var] } text += dirs.Name spaces := "" @@ -455,9 +462,12 @@ func i_ui(data *HardData) { ui.def_style = tcell.StyleDefault. Background(tcell.ColorReset). Foreground(tcell.ColorReset) + ui.dir_style = tcell.StyleDefault. + Background(tcell.ColorReset). + Foreground(tcell.ColorBlue).Dim(true).Bold(true) ui.title_style = tcell.StyleDefault. - Background(tcell.ColorReset). - Foreground(tcell.ColorBlue).Dim(true).Bold(true) + Background(tcell.ColorReset). + Foreground(tcell.ColorBlue).Dim(true).Bold(true) ui.s.SetStyle(ui.def_style) for { ui.dim[W], ui.dim[H], _ = term.GetSize(0) -- cgit v1.2.3