From c8a1c67494bc6941b4a2f1298bf88a80543988ad Mon Sep 17 00:00:00 2001 From: Lajos Koszti Date: Sat, 14 Mar 2015 12:03:52 +0100 Subject: Make sure render new styles into full menu Different styles makes the menu width different. When the original menu width is bigger than the newly selected style's width, the rendering produces pretty strange effects: The old style's frame not cleared, so it was rendered and visible next to the new style edge. With this change, the menu width will be as wide as the widest menu item. Style switching still not perfect, because the height of a menu item is from the "first" selected menu, also font color are not updated. --- src/FbTk/Menu.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/FbTk/Menu.cc b/src/FbTk/Menu.cc index 0a7c20a..333a609 100644 --- a/src/FbTk/Menu.cc +++ b/src/FbTk/Menu.cc @@ -430,6 +430,8 @@ 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; -- cgit v0.11.2