aboutsummaryrefslogtreecommitdiffstats
path: root/i_ui.go
diff options
context:
space:
mode:
authorJoe <rbo@gmx.us>2023-12-19 20:20:20 +0100
committerJoe <rbo@gmx.us>2023-12-19 20:20:20 +0100
commit1de16ef61f7e92de9127215e6ff3310685744017 (patch)
treed03f66ec44bac65c211f753c00e16de2023dcf08 /i_ui.go
parentfking good (diff)
downloadhardflip-1de16ef61f7e92de9127215e6ff3310685744017.tar.gz
hardflip-1de16ef61f7e92de9127215e6ff3310685744017.tar.bz2
hardflip-1de16ef61f7e92de9127215e6ff3310685744017.tar.xz
hardflip-1de16ef61f7e92de9127215e6ff3310685744017.tar.zst
hardflip-1de16ef61f7e92de9127215e6ff3310685744017.zip
warn
Diffstat (limited to 'i_ui.go')
-rw-r--r--i_ui.go12
1 files changed, 7 insertions, 5 deletions
diff --git a/i_ui.go b/i_ui.go
index 1a6e8eb..5c0f526 100644
--- a/i_ui.go
+++ b/i_ui.go
@@ -116,18 +116,20 @@ func i_bottom_text(s tcell.Screen, t [2]int) {
}
func i_draw_zhosts_box(s tcell.Screen, t [2]int, def_style tcell.Style) {
+ text := "Hosts list empty. Add hosts by pressing (a)"
left, right :=
- (t[W] / 2) - 20,
- (t[W] / 2) + 20
+ (t[W] / 2) - (len(text) / 2) - 5,
+ (t[W] / 2) + (len(text) / 2) + 5
top, bot :=
(t[H] / 2) - 3,
(t[H] / 2) + 3
i_draw_box(s, left, top, right, bot, "")
if left < t[W] / 3 {
for y := top + 1; y < bot; y++ {
- s.SetContent(t[W] / 3, y, ' ', nil, def_style)
+ s.SetContent(t[W] / 3, y, ' ', nil, def_style)
}
}
+ i_draw_text(s, (t[W] / 2) - (len(text) / 2), t[H] / 2, right, t[H] / 2, def_style, text)
}
func i_hosts_panel(s tcell.Screen, t [2]int,
@@ -135,7 +137,7 @@ func i_hosts_panel(s tcell.Screen, t [2]int,
sel uint64, sel_max uint64) {
i_draw_box(s, 0, 0,
t[W] / 3, t[H] - 2,
- " hosts ")
+ " Hosts ")
host := lhost.head
for host != nil {
style := def_style
@@ -180,7 +182,7 @@ func i_info_panel(s tcell.Screen, t [2]int,
i_draw_box(s, (t[W] / 3), 0,
t[W] - 1, t[H] - 2,
- " infos ")
+ " Infos ")
s.SetContent(t[W] / 3, 0, tcell.RuneTTee, nil, def_style)
s.SetContent(t[W] / 3, t[H] - 2, tcell.RuneBTee, nil, def_style)
if lhost.head == nil {