aboutsummaryrefslogtreecommitdiff
path: root/src/FbTk/Menu.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/FbTk/Menu.cc')
-rw-r--r--src/FbTk/Menu.cc14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/FbTk/Menu.cc b/src/FbTk/Menu.cc
index a1fdf8c..c784498 100644
--- a/src/FbTk/Menu.cc
+++ b/src/FbTk/Menu.cc
@@ -22,7 +22,7 @@
22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
23// DEALINGS IN THE SOFTWARE. 23// DEALINGS IN THE SOFTWARE.
24 24
25// $Id: Menu.cc,v 1.80 2004/09/09 14:29:10 akir Exp $ 25// $Id: Menu.cc,v 1.81 2004/09/11 12:33:14 rathnor Exp $
26 26
27//use GNU extensions 27//use GNU extensions
28#ifndef _GNU_SOURCE 28#ifndef _GNU_SOURCE
@@ -433,7 +433,7 @@ void Menu::update(int active_index) {
433 } 433 }
434 434
435 int itmp = (theme().itemHeight() * menu.persub); 435 int itmp = (theme().itemHeight() * menu.persub);
436 menu.frame_h = itmp < 0 ? 0 : itmp; 436 menu.frame_h = itmp < 1 ? 1 : itmp;
437 437
438 int new_width = (menu.sublevels * menu.item_w); 438 int new_width = (menu.sublevels * menu.item_w);
439 int new_height = menu.frame_h; 439 int new_height = menu.frame_h;
@@ -442,8 +442,12 @@ void Menu::update(int active_index) {
442 new_height += theme().titleHeight() + ((menu.frame_h > 0)?menu.title.borderWidth():0); 442 new_height += theme().titleHeight() + ((menu.frame_h > 0)?menu.title.borderWidth():0);
443 443
444 444
445 if (new_width < 1) 445 if (new_width < 1) {
446 new_width = menu.item_w; 446 if (menu.item_w > 0)
447 new_width = menu.item_w;
448 else
449 new_width = 1;
450 }
447 451
448 if (new_height < 1) 452 if (new_height < 1)
449 new_height = 1; 453 new_height = 1;
@@ -548,7 +552,7 @@ void Menu::update(int active_index) {
548 } 552 }
549 553
550 menu.frame.moveResize(0, ((title_vis) ? menu.title.y() + menu.title.height() + 554 menu.frame.moveResize(0, ((title_vis) ? menu.title.y() + menu.title.height() +
551 menu.title.borderWidth()*2 : 0), 555 menu.title.borderWidth()*2 : 1),
552 width(), menu.frame_h); 556 width(), menu.frame_h);
553 557
554 558