diff options
author | Juan Gonzalez Lopez <j.gonzalez@nubalia.com> | 2016-04-23 20:54:03 (GMT) |
---|---|---|
committer | Mathias Gumz <akira@fluxbox.org> | 2016-04-25 17:30:38 (GMT) |
commit | 5d90b7984cb73ede2763346382fb6e038ae5d16d (patch) | |
tree | 16930780d0b1207a06a011693e07a9e44a4ebec5 | |
parent | 7b8e4413f8c68f13a36945b9482218ec6be4be5e (diff) | |
download | fluxbox-5d90b7984cb73ede2763346382fb6e038ae5d16d.zip fluxbox-5d90b7984cb73ede2763346382fb6e038ae5d16d.tar.bz2 |
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.
-rw-r--r-- | src/FbTk/Menu.cc | 7 |
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++; |