out of range text print fixes
This commit is contained in:
parent
f8a641d22c
commit
f9a73817c3
|
@ -52,8 +52,8 @@ runcharts:
|
|||
x: 0
|
||||
y: 15
|
||||
size:
|
||||
x: 4
|
||||
y: 4
|
||||
x: 15
|
||||
y: 15
|
||||
- title: MONGO COLLECTIONS COUNT
|
||||
items:
|
||||
- label: POSTS
|
||||
|
|
|
@ -81,7 +81,7 @@ func (l *Layout) HandleConsoleEvent(e string) {
|
|||
l.menu.idle()
|
||||
chart := l.getSelectedComponent().Drawable.(*RunChart)
|
||||
chart.MoveSelection(0)
|
||||
case MenuOptionExit:
|
||||
case MenuOptionResume:
|
||||
l.mode = ModeDefault
|
||||
l.menu.idle()
|
||||
}
|
||||
|
|
|
@ -29,7 +29,7 @@ const (
|
|||
MenuOptionMove MenuOption = "MOVE"
|
||||
MenuOptionResize MenuOption = "RESIZE"
|
||||
MenuOptionPinpoint MenuOption = "PINPOINT"
|
||||
MenuOptionExit MenuOption = "EXIT"
|
||||
MenuOptionResume MenuOption = "RESUME"
|
||||
)
|
||||
|
||||
func NewMenu() *Menu {
|
||||
|
@ -38,7 +38,7 @@ func NewMenu() *Menu {
|
|||
block.BorderStyle = ui.NewStyle(console.ColorDarkGrey)
|
||||
return &Menu{
|
||||
Block: block,
|
||||
options: []MenuOption{MenuOptionMove, MenuOptionResize, MenuOptionPinpoint, MenuOptionExit},
|
||||
options: []MenuOption{MenuOptionMove, MenuOptionResize, MenuOptionPinpoint, MenuOptionResume},
|
||||
mode: MenuModeIdle,
|
||||
option: MenuOptionMove,
|
||||
}
|
||||
|
@ -181,7 +181,7 @@ func (m *Menu) printAllDirectionsArrowSign(buffer *ui.Buffer, y int) {
|
|||
func (m *Menu) renderOptions(buffer *ui.Buffer) {
|
||||
|
||||
// TODO extract styles to console.Palette
|
||||
highlightedStyle := ui.NewStyle(console.ColorWhite, console.ColorClear, ui.ModifierReverse)
|
||||
highlightedStyle := ui.NewStyle(console.ColorOlive, console.ColorBlack, ui.ModifierReverse)
|
||||
regularStyle := ui.NewStyle(console.ColorWhite)
|
||||
|
||||
offset := 1
|
||||
|
@ -194,11 +194,10 @@ func (m *Menu) renderOptions(buffer *ui.Buffer) {
|
|||
|
||||
if option != MenuOptionPinpoint || m.component.Type == TypeRunChart {
|
||||
offset += 2
|
||||
buffer.SetString(
|
||||
string(option),
|
||||
style,
|
||||
getMiddlePoint(m.Block, string(option), offset-5),
|
||||
)
|
||||
point := getMiddlePoint(m.Block, string(option), offset-5)
|
||||
if point.In(m.GetRect()) {
|
||||
buffer.SetString(string(option), style, point)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue