mirror of https://github.com/cjbassi/gotop.git
Change proc widget to load after startup
This commit is contained in:
parent
44a8caa3ee
commit
1225515f3e
31
main.go
31
main.go
|
@ -204,8 +204,6 @@ func main() {
|
|||
|
||||
widgetColors()
|
||||
|
||||
<-procLoaded
|
||||
|
||||
// inits termui
|
||||
err := ui.Init()
|
||||
if err != nil {
|
||||
|
@ -233,32 +231,29 @@ func main() {
|
|||
ui.Render(ui.Body)
|
||||
drawTick := time.NewTicker(interval)
|
||||
for {
|
||||
if helpVisible {
|
||||
select {
|
||||
case <-helpToggled:
|
||||
if helpVisible {
|
||||
ui.Clear()
|
||||
ui.Render(help)
|
||||
} else {
|
||||
ui.Render(ui.Body)
|
||||
}
|
||||
case <-termResized:
|
||||
if !helpVisible {
|
||||
ui.Clear()
|
||||
ui.Render(ui.Body)
|
||||
} else if helpVisible {
|
||||
ui.Clear()
|
||||
ui.Render(help)
|
||||
}
|
||||
case <-keyPressed:
|
||||
if !helpVisible {
|
||||
} else {
|
||||
select {
|
||||
case <-procLoaded:
|
||||
ui.Render(proc)
|
||||
}
|
||||
case <-zoomed:
|
||||
if !helpVisible {
|
||||
case <-helpToggled:
|
||||
ui.Clear()
|
||||
ui.Render(help)
|
||||
case <-termResized:
|
||||
ui.Clear()
|
||||
ui.Render(ui.Body)
|
||||
}
|
||||
case <-keyPressed:
|
||||
ui.Render(proc)
|
||||
case <-zoomed:
|
||||
ui.Render(cpu, mem)
|
||||
case <-drawTick.C:
|
||||
if !helpVisible {
|
||||
ui.Render(ui.Body)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue