diff --git a/plugins/statusscreen/statusscreen.go b/plugins/statusscreen/statusscreen.go index 17f748432d03ea66402f7411b47d0beb05aa15cd..362cf37ea3863777837493cab56e6c53b7138bd3 100644 --- a/plugins/statusscreen/statusscreen.go +++ b/plugins/statusscreen/statusscreen.go @@ -58,6 +58,9 @@ func run(plugin *node.Plugin) { content := tview.NewGrid() content.SetBackgroundColor(tcell.ColorWhite) content.SetColumns(0) + content.SetBorders(false) + content.SetOffset(0, 0) + content.SetGap(0, 0) footer := newPrimitive("") footer.SetBackgroundColor(tcell.ColorDarkMagenta) @@ -88,8 +91,9 @@ func run(plugin *node.Plugin) { app.SetBeforeDrawFunc(func(screen tcell.Screen) bool { headerBar.Update() - rows := make([]int, 1) + rows := make([]int, 2) rows[0] = 1 + rows[1] = 1 _, _, _, height := content.GetRect() for i := 0; i < len(messageLog) && i < height-2; i++ { rows = append(rows, 1) @@ -102,12 +106,21 @@ func run(plugin *node.Plugin) { blankLine.SetBackgroundColor(tcell.ColorWhite) content.AddItem(blankLine, 0, 0, 1, 1, 0, 0, false) - for i, message := range messageLog[len(messageLog)-len(rows)-1+2:] { + logStart := len(messageLog) - (len(rows) - 2) + if logStart < 0 { + logStart = 0 + } + + for i, message := range messageLog[logStart:] { if i < height-2 { content.AddItem(NewUILogEntry(*message).Primitive, i+1, 0, 1, 1, 0, 0, false) } } + blankLine = newPrimitive("") + blankLine.SetBackgroundColor(tcell.ColorWhite) + content.AddItem(blankLine, height-1, 0, 1, 1, 0, 0, false) + return false })