aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/FbTk/Menu.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/FbTk/Menu.cc b/src/FbTk/Menu.cc
index 333a609..484a399 100644
--- a/src/FbTk/Menu.cc
+++ b/src/FbTk/Menu.cc
@@ -430,9 +430,6 @@ void Menu::updateMenu() {
430 m_item_w = std::max(iw, m_item_w); 430 m_item_w = std::max(iw, m_item_w);
431 } 431 }
432 432
433 // the menu width should be as wide as the widest menu item
434 w = m_item_w;
435
436 // calculate needed columns 433 // calculate needed columns
437 m_columns = 0; 434 m_columns = 0;
438 m_rows_per_column = 0; 435 m_rows_per_column = 0;
@@ -444,6 +441,10 @@ void Menu::updateMenu() {
444 } 441 }
445 442
446 m_columns = std::max(m_min_columns, m_columns); 443 m_columns = std::max(m_min_columns, m_columns);
444
445 // the menu width should be as wide as the widest menu item
446 w = m_item_w * m_columns;
447
447 m_rows_per_column = m_items.size() / m_columns; 448 m_rows_per_column = m_items.size() / m_columns;
448 if (m_items.size() % m_columns) 449 if (m_items.size() % m_columns)
449 m_rows_per_column++; 450 m_rows_per_column++;