| 75 | } |
| 76 | |
| 77 | func RenderHeader(title string, width int, selected bool) string { |
| 78 | if selected { |
| 79 | body := Header(fmt.Sprintf("%s%s ", selectStr, title)) |
| 80 | bodyLen := len(vtclean.Clean(body, false)) |
| 81 | repeatCount := width - bodyLen - 2 |
| 82 | if repeatCount < 0 { |
| 83 | repeatCount = 0 |
| 84 | } |
| 85 | return fmt.Sprintf("%s%s%s%s\n", selectedLeftBracketStr, body, selectedRightBracketStr, strings.Repeat(selectedFillStr, repeatCount)) |
| 86 | // return fmt.Sprintf("%s%s%s%s\n", Selected(selectedLeftBracketStr), body, Selected(selectedRightBracketStr), Selected(strings.Repeat(selectedFillStr, width-bodyLen-2))) |
| 87 | // return fmt.Sprintf("%s%s%s%s\n", Selected(selectedLeftBracketStr), body, Selected(selectedRightBracketStr), strings.Repeat(selectedFillStr, width-bodyLen-2)) |
| 88 | } |
| 89 | body := Header(fmt.Sprintf(" %s ", title)) |
| 90 | bodyLen := len(vtclean.Clean(body, false)) |
| 91 | repeatCount := width - bodyLen - 2 |
| 92 | if repeatCount < 0 { |
| 93 | repeatCount = 0 |
| 94 | } |
| 95 | return fmt.Sprintf("%s%s%s%s\n", leftBracketStr, body, rightBracketStr, strings.Repeat(fillStr, repeatCount)) |
| 96 | } |
| 97 | |
| 98 | func RenderHelpKey(control, title string, selected bool) string { |
| 99 | if selected { |