diff --git a/cmd/mop.go b/cmd/mop.go index 07b9b61..ca8a1af 100644 --- a/cmd/mop.go +++ b/cmd/mop.go @@ -68,11 +68,7 @@ loop: } } else if event.Ch == 'p' || event.Ch == 'P' { paused = !paused - if paused { - screen.Draw("\n Paused ") - } else { - screen.Draw("\n ") - } + screen.Draw(paused) } else if event.Ch == '?' || event.Ch == 'h' || event.Ch == 'H' { showingHelp = true screen.Clear().Draw(help) diff --git a/screen.go b/screen.go index 4a10e7e..99b8c94 100644 --- a/screen.go +++ b/screen.go @@ -82,6 +82,14 @@ func (screen *Screen) Draw(objects ...interface{}) *Screen { case time.Time: timestamp := ptr.(time.Time).Format(`3:04:05pm PST`) screen.DrawLine(0, 0, `` + timestamp + ``) + case bool: + timestamp := time.Now().Format(`3:04:05pm PST`) + if ptr.(bool) { + timestamp = `Paused ` + timestamp + `` + } else { + timestamp = ` ` + timestamp + } + screen.DrawLine(0, 0, `` + timestamp + ``) default: screen.draw(ptr.(string)) }