diff options
| author | Maxime Coste <frrrwww@gmail.com> | 2014-11-20 13:56:37 +0000 |
|---|---|---|
| committer | Maxime Coste <frrrwww@gmail.com> | 2014-11-20 13:56:37 +0000 |
| commit | 04ecb2cc5ae9cd860d6a1e697e362e9d1f34049d (patch) | |
| tree | dd5ad0f6c9890339ad139d69cd364ecae4ab7c10 | |
| parent | a444cd1d60cfd87049b191d5082de3a505fbd54a (diff) | |
Wrap info boxes text in ncurses display even in Inline menu style
| -rw-r--r-- | src/ncurses.cc | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/src/ncurses.cc b/src/ncurses.cc index 1a93d04d..45e032bf 100644 --- a/src/ncurses.cc +++ b/src/ncurses.cc @@ -762,14 +762,24 @@ void NCursesUI::info_show(StringView title, StringView content, anchor = CharCoord{m_status_on_top ? 0 : m_dimensions.line, m_dimensions.column-1}; } - else if (m_status_on_top) - anchor.line += 1; + else + { + if (m_status_on_top) + anchor.line += 1; + CharCount col = anchor.column; + if (style == InfoStyle::MenuDoc and m_menu_win) + col = window_pos(m_menu_win).column + window_size(m_menu_win).column; + + for (auto& line : wrap_lines(content, m_dimensions.column - col)) + fancy_info_box += line + "\n"; + info_box = fancy_info_box; + } CharCoord size = compute_needed_size(info_box); CharCoord pos; - if (style == InfoStyle::MenuDoc and m_menu_win and m_menu_columns == 1) + if (style == InfoStyle::MenuDoc and m_menu_win) pos = window_pos(m_menu_win) + - CharCoord{0_line, window_size(m_menu_win).column}; + CharCoord{0_line, window_size(m_menu_win).column}; else pos = compute_pos(anchor, size, m_menu_win, style == InfoStyle::InlineAbove); |
