aboutsummaryrefslogtreecommitdiffstats
path: root/i_ui.go
diff options
context:
space:
mode:
authorJoe <rbo@gmx.us>2023-12-26 20:20:20 +0100
committerJoe <rbo@gmx.us>2023-12-26 20:20:20 +0100
commit1590c30cbb2627a6175f08ab83185a1d6a054f09 (patch)
treebff0a5ae616bce46dcaa100913922a7a80174c4f /i_ui.go
parentcool (diff)
downloadhardflip-1590c30cbb2627a6175f08ab83185a1d6a054f09.tar.gz
hardflip-1590c30cbb2627a6175f08ab83185a1d6a054f09.tar.bz2
hardflip-1590c30cbb2627a6175f08ab83185a1d6a054f09.tar.xz
hardflip-1590c30cbb2627a6175f08ab83185a1d6a054f09.tar.zst
hardflip-1590c30cbb2627a6175f08ab83185a1d6a054f09.zip
up
Diffstat (limited to 'i_ui.go')
-rw-r--r--i_ui.go21
1 files changed, 13 insertions, 8 deletions
diff --git a/i_ui.go b/i_ui.go
index e63428c..ec38cf6 100644
--- a/i_ui.go
+++ b/i_ui.go
@@ -132,7 +132,7 @@ func i_bottom_text(ui HardUI) {
}
func i_draw_zhosts_box(ui HardUI) {
- text := "Hosts list empty. Add hosts by pressing (a)"
+ text := "Hosts list empty. Add hosts/folders by pressing (a/m)"
left, right :=
(ui.dim[W] / 2) - (len(text) / 2) - 5,
(ui.dim[W] / 2) + (len(text) / 2) + 5
@@ -206,7 +206,7 @@ func i_draw_delete_box(ui HardUI, host *HostNode) {
ui.def_style, "o")
}
-func i_host_panel(ui HardUI, opts HardOpts, lhost *HostList) {
+func i_host_panel(ui HardUI, opts HardOpts, ldirs *DirsList) {
i_draw_box(ui.s, 0, 0,
ui.dim[W] / 3, ui.dim[H] - 2,
" Hosts ", false)
@@ -430,7 +430,8 @@ func i_ui(data *HardData) {
var err error
ui := &data.ui
ui.s, err = tcell.NewScreen()
- ui.sel_max = data.lhost.count()
+ count_dirs, count_hosts := data.ldirs.count()
+ ui.sel_max = count_dirs + count_hosts
if err != nil {
c_die("view", err)
@@ -449,14 +450,18 @@ func i_ui(data *HardData) {
ui.dim[W], ui.dim[H], _ = term.GetSize(0)
ui.s.Clear()
i_bottom_text(*ui)
- i_host_panel(data.ui, data.opts, data.lhost)
- i_info_panel(data.ui, data.lhost)
- if data.lhost.head == nil {
+ i_host_panel(data.ui, data.opts, data.ldirs)
+ // TODO - info panel
+
+ // i_info_panel(data.ui, data.lhost)
+ if ui.sel_max == 0 {
i_draw_zhosts_box(*ui)
}
if ui.mode == DELETE_MODE {
- host := data.lhost.sel(ui.sel)
- i_draw_delete_box(*ui, host)
+ // TODO - delete mode
+
+ // host := data.lhost.sel(ui.sel)
+ // i_draw_delete_box(*ui, host)
}
ui.s.Show()
i_events(data)