Try to restore menu after a resize
This commit is contained in:
parent
f3bce27a08
commit
9f78f9bfd5
|
@ -437,6 +437,12 @@ void NCursesUI::check_resize(bool force)
|
|||
|
||||
if (char* csr = tigetstr((char*)"csr"))
|
||||
putp(tparm(csr, (long)0, (long)ws.ws_row));
|
||||
|
||||
if (not m_items.empty())
|
||||
{
|
||||
auto items = std::move(m_items);
|
||||
menu_show(items, m_menu_anchor, m_menu_fg, m_menu_bg, m_menu_style);
|
||||
}
|
||||
}
|
||||
else
|
||||
kak_assert(false);
|
||||
|
@ -618,6 +624,8 @@ void NCursesUI::menu_show(ConstArrayView<DisplayLine> items,
|
|||
|
||||
m_menu_fg = fg;
|
||||
m_menu_bg = bg;
|
||||
m_menu_style = style;
|
||||
m_menu_anchor = anchor;
|
||||
|
||||
if (style == MenuStyle::Prompt)
|
||||
anchor = CharCoord{m_status_on_top ? 0_line : m_dimensions.line, 0};
|
||||
|
|
|
@ -91,6 +91,8 @@ private:
|
|||
Vector<DisplayLine> m_items;
|
||||
Face m_menu_fg;
|
||||
Face m_menu_bg;
|
||||
CharCoord m_menu_anchor;
|
||||
MenuStyle m_menu_style;
|
||||
int m_selected_item = 0;
|
||||
int m_menu_columns = 1;
|
||||
LineCount m_menu_top_line = 0;
|
||||
|
|
Loading…
Reference in New Issue
Block a user