diff options
| author | Maxime Coste <frrrwww@gmail.com> | 2013-09-16 19:15:13 +0100 |
|---|---|---|
| committer | Maxime Coste <frrrwww@gmail.com> | 2013-09-16 19:15:13 +0100 |
| commit | 06e06d6ea67f10ececd7232471505e7d8f36d509 (patch) | |
| tree | 478b39028f534bb6b89b16ffcffa54c83c61b3c2 /src/ncurses.cc | |
| parent | 49903523a7f28c18d324bf605876b9d18a97047b (diff) | |
remove print_status from UserInterface, pass status line to draw
Client store the current status line. This way calls to print status
do not force the user interface to display directly.
Diffstat (limited to 'src/ncurses.cc')
| -rw-r--r-- | src/ncurses.cc | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/src/ncurses.cc b/src/ncurses.cc index f5fcb973..8d29a62e 100644 --- a/src/ncurses.cc +++ b/src/ncurses.cc @@ -240,6 +240,7 @@ void NCursesUI::draw_line(const DisplayLine& line, CharCount col_index) const } void NCursesUI::draw(const DisplayBuffer& display_buffer, + const DisplayLine& status_line, const DisplayLine& mode_line) { LineCount line_index = 0; @@ -265,10 +266,10 @@ void NCursesUI::draw(const DisplayBuffer& display_buffer, move((int)m_dimensions.line, 0); clrtoeol(); - draw_line(m_status_line, 0); + draw_line(status_line, 0); CharCount status_len = mode_line.length(); // only draw mode_line if it does not overlap one status line - if (m_dimensions.column - m_status_line.length() > status_len + 1) + if (m_dimensions.column - status_line.length() > status_len + 1) { CharCount col = m_dimensions.column - status_len; move((int)m_dimensions.line, (int)col); @@ -358,15 +359,6 @@ Key NCursesUI::get_key() return Key::Invalid; } -void NCursesUI::print_status(const DisplayLine& status) -{ - m_status_line = status; - move((int)m_dimensions.line, 0); - clrtoeol(); - draw_line(status, 0); - redraw(); -} - void NCursesUI::draw_menu() { // menu show may have not created the window if it did not fit. |
