Skip to content
This repository has been archived by the owner on Nov 1, 2022. It is now read-only.

Commit

Permalink
refactor: Constants
Browse files Browse the repository at this point in the history
  • Loading branch information
rndstr committed Jul 20, 2018
1 parent 8249d5f commit 5a0d706
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions update/menu.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,16 @@ import (
"github.com/weaveworks/flux"
)

// Escape sequences.
const (
moveCursorUp = "\033[%dA"
moveStartOfLine = "\r"
hideCursor = "\033[?25l"
showCursor = "\033[?25h"
boldText = "\033[1m"
resetText = "\033[0m"
// Escape sequences.
moveCursorUp = "\033[%dA"
hideCursor = "\033[?25l"
showCursor = "\033[?25h"

// Glyphs.
charRightArrow = "\u21d2"
charCircleFilled = "\u25c9"
charCircle = "\u25ef"

tableHeading = "CONTROLLER \tSTATUS \tUPDATES"
)
Expand Down Expand Up @@ -231,7 +233,7 @@ func (m *Menu) renderItem(item menuItem, inline bool) string {
func (m *Menu) renderInteractiveItem(item menuItem, inline bool, index int) string {
pre := bytes.Buffer{}
if index == m.cursor {
pre.WriteString("\u21d2")
pre.WriteString(charRightArrow)
} else {
pre.WriteString(" ")
}
Expand Down Expand Up @@ -262,9 +264,9 @@ func (i menuItem) checkbox() string {
case !i.checkable():
return " "
case i.checked:
return "\u25c9"
return charCircleFilled
default:
return "\u25ef"
return charCircle
}
}

Expand Down

0 comments on commit 5a0d706

Please sign in to comment.