diff options
author | Joe <rbo@gmx.us> | 2023-12-26 20:20:20 +0100 |
---|---|---|
committer | Joe <rbo@gmx.us> | 2023-12-26 20:20:20 +0100 |
commit | db553a53509678b17ebedbdd93d7a5c5a9e8e5f4 (patch) | |
tree | 07347e0199373e9d26ae391d2b4321b4dcdb7ac2 | |
parent | it builds at least (diff) | |
download | hardflip-db553a53509678b17ebedbdd93d7a5c5a9e8e5f4.tar.gz hardflip-db553a53509678b17ebedbdd93d7a5c5a9e8e5f4.tar.bz2 hardflip-db553a53509678b17ebedbdd93d7a5c5a9e8e5f4.tar.xz hardflip-db553a53509678b17ebedbdd93d7a5c5a9e8e5f4.tar.zst hardflip-db553a53509678b17ebedbdd93d7a5c5a9e8e5f4.zip |
must go
-rw-r--r-- | i_ui.go | 20 |
1 files changed, 15 insertions, 5 deletions
@@ -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) |