diff --git a/colors.go b/colors.go index b571fa4..439e3c6 100644 --- a/colors.go +++ b/colors.go @@ -13,6 +13,7 @@ var ( styleWhiteBold = tcell.StyleDefault.Background(tcell.ColorReset).Foreground(tcell.ColorWhite).Bold(true) styleBrown = tcell.StyleDefault.Background(tcell.ColorReset).Foreground(tcell.Color94) styleBrownBold = tcell.StyleDefault.Background(tcell.ColorReset).Foreground(tcell.Color94).Bold(true) + styleGray = tcell.StyleDefault.Background(tcell.ColorReset).Foreground(tcell.ColorGray) ) // TODO: check supported number of colors diff --git a/main.go b/main.go index 9ce362e..0eb6f1d 100644 --- a/main.go +++ b/main.go @@ -49,8 +49,22 @@ func main() { log.Panicln(err.Error()) } - // TODO: draw message - // -m, --message=STR Attach message next to the tree + if opts.message != "" { + // upper border + sc.x = int(opts.msgX) + sc.y = int(opts.msgY) + sc.draw("+"+strings.Repeat("-", len(opts.message)+2)+"+", styleGray) + // center with message and front- and back-border + sc.x = int(opts.msgX) + sc.y = int(opts.msgY) + 1 + sc.draw("| ", styleGray) + sc.draw(opts.message, styleDefault) + sc.draw(" |", styleGray) + // lower border + sc.x = int(opts.msgX) + sc.y = int(opts.msgY) + 2 + sc.draw("+"+strings.Repeat("-", len(opts.message)+2)+"+", styleGray) + } // refresh screen evDrawn(sc)