forked from sloum/bombadillo
Clarifying comment
This commit is contained in:
parent
5a82541dee
commit
43b9953c80
|
@ -39,7 +39,6 @@ func (s *Screen) AddMsgBar(row int, title, msg string, showTitle bool) {
|
||||||
// DrawAllWindows loops over every window in the Screen struct and
|
// DrawAllWindows loops over every window in the Screen struct and
|
||||||
// draws it to screen in index order (smallest to largest)
|
// draws it to screen in index order (smallest to largest)
|
||||||
func (s Screen) DrawAllWindows() {
|
func (s Screen) DrawAllWindows() {
|
||||||
// s.Clear()
|
|
||||||
for _, w := range s.Windows {
|
for _, w := range s.Windows {
|
||||||
if w.Show {
|
if w.Show {
|
||||||
w.DrawWindow()
|
w.DrawWindow()
|
||||||
|
@ -56,6 +55,15 @@ func (s Screen) Clear() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Clears message/error/command area
|
||||||
|
func (s *Screen) ClearCommandArea() {
|
||||||
|
MoveCursorTo(s.Height-1, 1)
|
||||||
|
Clear("line")
|
||||||
|
MoveCursorTo(s.Height, 1)
|
||||||
|
Clear("line")
|
||||||
|
MoveCursorTo(s.Height-1, 1)
|
||||||
|
}
|
||||||
|
|
||||||
// ReflashScreen checks for a screen resize and resizes windows if
|
// ReflashScreen checks for a screen resize and resizes windows if
|
||||||
// needed then redraws the screen. It takes a bool to decide whether
|
// needed then redraws the screen. It takes a bool to decide whether
|
||||||
// to redraw the full screen or just the content. On a resize
|
// to redraw the full screen or just the content. On a resize
|
||||||
|
@ -64,12 +72,9 @@ func (s *Screen) ReflashScreen(clearScreen bool) {
|
||||||
if clearScreen {
|
if clearScreen {
|
||||||
s.DrawAllWindows()
|
s.DrawAllWindows()
|
||||||
s.DrawMsgBars()
|
s.DrawMsgBars()
|
||||||
|
s.ClearCommandArea()
|
||||||
} else {
|
} else {
|
||||||
for _, w := range s.Windows {
|
s.DrawAllWindows()
|
||||||
if w.Show {
|
|
||||||
w.DrawWindow()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue