summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/FbTk/Menu.cc21
1 files changed, 10 insertions, 11 deletions
diff --git a/src/FbTk/Menu.cc b/src/FbTk/Menu.cc
index 370afb8..a4aed46 100644
--- a/src/FbTk/Menu.cc
+++ b/src/FbTk/Menu.cc
@@ -388,10 +388,6 @@ void Menu::enableTitle() {
388} 388}
389 389
390void Menu::updateMenu(int active_index) { 390void Menu::updateMenu(int active_index) {
391 if (!m_visible) {
392 m_need_update = true;
393 return;
394 }
395 if (m_title_vis) { 391 if (m_title_vis) {
396 menu.item_w = theme().titleFont().textWidth(menu.label.c_str(), 392 menu.item_w = theme().titleFont().textWidth(menu.label.c_str(),
397 menu.label.size()); 393 menu.label.size());
@@ -425,9 +421,6 @@ void Menu::updateMenu(int active_index) {
425 menu.persub = 0; 421 menu.persub = 0;
426 } 422 }
427 423
428 if (menu.frame.alpha() != alpha())
429 menu.frame.setAlpha(alpha());
430
431 int itmp = (theme().itemHeight() * menu.persub); 424 int itmp = (theme().itemHeight() * menu.persub);
432 menu.frame_h = itmp < 1 ? 1 : itmp; 425 menu.frame_h = itmp < 1 ? 1 : itmp;
433 426
@@ -448,8 +441,16 @@ void Menu::updateMenu(int active_index) {
448 if (new_height < 1) 441 if (new_height < 1)
449 new_height = 1; 442 new_height = 1;
450 443
444 // must update main window size whether visible or not
445 // the rest can wait until the end
451 menu.window.resize(new_width, new_height); 446 menu.window.resize(new_width, new_height);
452 447
448 if (!m_visible)
449 return;
450
451 if (menu.frame.alpha() != alpha())
452 menu.frame.setAlpha(alpha());
453
453 Pixmap tmp = 0; 454 Pixmap tmp = 0;
454 if (m_title_vis && m_need_update) { 455 if (m_title_vis && m_need_update) {
455 tmp = menu.title_pixmap; 456 tmp = menu.title_pixmap;
@@ -1267,10 +1268,8 @@ void Menu::reconfigure() {
1267 1268
1268 menu.window.setBorderWidth(theme().borderWidth()); 1269 menu.window.setBorderWidth(theme().borderWidth());
1269 menu.title.setBorderWidth(theme().borderWidth()); 1270 menu.title.setBorderWidth(theme().borderWidth());
1270 1271
1271 if (m_visible) { 1272 updateMenu();
1272 updateMenu();
1273 }
1274} 1273}
1275 1274
1276 1275