From 5d90b7984cb73ede2763346382fb6e038ae5d16d Mon Sep 17 00:00:00 2001 From: Juan Gonzalez Lopez Date: Sat, 23 Apr 2016 22:54:03 +0200 Subject: Fix menus over a single column wide Fixes menus more than 1 column wide (such as the Placement menus for the Toolbar/Slit/Tabs) which stopped working with commit 3e4570b. --- src/FbTk/Menu.cc | 7 ++++--- 1 file 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() { m_item_w = std::max(iw, m_item_w); } - // the menu width should be as wide as the widest menu item - w = m_item_w; - // calculate needed columns m_columns = 0; m_rows_per_column = 0; @@ -444,6 +441,10 @@ void Menu::updateMenu() { } m_columns = std::max(m_min_columns, m_columns); + + // the menu width should be as wide as the widest menu item + w = m_item_w * m_columns; + m_rows_per_column = m_items.size() / m_columns; if (m_items.size() % m_columns) m_rows_per_column++; -- cgit v0.11.2