diff options
-rw-r--r-- | src/c_defs.go | 2 | ||||
-rw-r--r-- | src/i_host.go | 7 | ||||
-rw-r--r-- | src/i_ui.go | 13 |
3 files changed, 14 insertions, 8 deletions
diff --git a/src/c_defs.go b/src/c_defs.go index c248466..d893c20 100644 --- a/src/c_defs.go +++ b/src/c_defs.go @@ -85,7 +85,7 @@ const ( HEAD_STYLE = 3 ERR_STYLE = 4 TITLE_STYLE = 5 - SEL_STYLE = 6 + BOT_STYLE = 6 ) var ( diff --git a/src/i_host.go b/src/i_host.go index 5d74234..491d236 100644 --- a/src/i_host.go +++ b/src/i_host.go @@ -51,10 +51,13 @@ package main +import "github.com/gdamore/tcell/v2" + func i_host_panel_dirs(ui HardUI, icons bool, dir_icon uint8, dir *DirsNode, curr *DirsNode, line int) { style := ui.style[DIR_STYLE] if dir == curr { + style = style.Background(tcell.ColorBlack) style = style.Reverse(true) } text := "" @@ -79,6 +82,7 @@ func i_host_panel_host(ui HardUI, icons bool, depth uint16, host *HostNode, curr *HostNode, line int) { style := ui.style[DEF_STYLE] if host == curr { + // style = style.Background(tcell.ColorBlack) style = style.Reverse(true) } text := "" @@ -99,7 +103,8 @@ func i_host_panel_host(ui HardUI, icons bool, style, text) } -func i_draw_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, ui.style[BOX_STYLE], ui.style[HEAD_STYLE], " Hosts ", false) diff --git a/src/i_ui.go b/src/i_ui.go index 35b57ea..868f993 100644 --- a/src/i_ui.go +++ b/src/i_ui.go @@ -183,10 +183,10 @@ func i_draw_bottom_text(ui HardUI) { } i_draw_text(ui.s, 0, ui.dim[H] - 1, ui.dim[W], ui.dim[H] - 1, - ui.style[DEF_STYLE].Dim(true), text) + ui.style[BOT_STYLE], text) i_draw_text(ui.s, ui.dim[W] - 5, ui.dim[H] - 1, ui.dim[W], ui.dim[H] - 1, - ui.style[DEF_STYLE].Dim(true), " " + VERSION) + ui.style[BOT_STYLE], " " + VERSION) } func i_draw_zhosts_box(ui HardUI) { @@ -229,11 +229,11 @@ func i_draw_load_error_msg(ui HardUI, load_err []error) { if line < 0 { line = 0 } - for i, err := range load_err { + for _, err := range load_err { line += 1 err_str := fmt.Sprintf("%v", err) i_draw_text(ui.s, left, line, right, line, - ui.style[ERR_STYLE], strconv.Itoa(i + 1) + " " + err_str) + ui.style[ERR_STYLE], err_str) } } @@ -361,8 +361,9 @@ func i_ui(data_dir string, opts HardOpts) { ui.style[TITLE_STYLE] = tcell.StyleDefault. Background(tcell.ColorReset). Foreground(tcell.ColorBlue).Dim(true).Bold(true) - ui.style[SEL_STYLE] = tcell.StyleDefault.Background(tcell.ColorBlack) - // TODO: sel_style + ui.style[BOT_STYLE] = tcell.StyleDefault. + Background(tcell.ColorReset). + Foreground(tcell.ColorBlue).Dim(true) ui.s.SetStyle(ui.style[DEF_STYLE]) ui.dim[W], ui.dim[H], _ = term.GetSize(0) ldirs, litems, load_err := i_load_ui(data_dir, opts, &ui) |