Fix some cases where menu items are truncated needlessly
This commit is contained in:
parent
daf041e839
commit
788c358720
|
@ -649,10 +649,10 @@ void NCursesUI::menu_show(ConstArrayView<DisplayLine> items,
|
||||||
longest = max(longest, item.length());
|
longest = max(longest, item.length());
|
||||||
|
|
||||||
const bool is_prompt = style == MenuStyle::Prompt;
|
const bool is_prompt = style == MenuStyle::Prompt;
|
||||||
m_menu_columns = is_prompt ? max((int)((maxsize.column - 1) / longest), 1) : 1;
|
m_menu_columns = is_prompt ? max((int)((maxsize.column-1) / (longest+1)), 1) : 1;
|
||||||
|
|
||||||
CharCount maxlen = maxsize.column-1;
|
CharCount maxlen = maxsize.column-1;
|
||||||
if (m_menu_columns > 1)
|
if (m_menu_columns > 1 and item_count > 1)
|
||||||
maxlen = maxlen / m_menu_columns - 1;
|
maxlen = maxlen / m_menu_columns - 1;
|
||||||
|
|
||||||
for (auto& item : items)
|
for (auto& item : items)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user