Author: manolo
Date: 2011-05-10 09:46:42 -0700 (Tue, 10 May 2011)
New Revision: 8645
Log:
Fix STR #2597.

Modified:
   branches/branch-1.3/fluid/Fl_Menu_Type.cxx

Modified: branches/branch-1.3/fluid/Fl_Menu_Type.cxx
===================================================================
--- branches/branch-1.3/fluid/Fl_Menu_Type.cxx  2011-05-10 15:37:05 UTC (rev 
8644)
+++ branches/branch-1.3/fluid/Fl_Menu_Type.cxx  2011-05-10 16:46:42 UTC (rev 
8645)
@@ -470,7 +470,10 @@
       const char *mName = mi->menu_name(i);
       for (Fl_Type* q = next; q && q->is_menu_item(); q = q->next) {
         if (((Fl_Menu_Item_Type*)q)->label()) nLabel++;
-        nItem++;
+       int thislevel = q->level; if (q->is_parent()) thislevel++;
+       int nextlevel =
+           (q->next && q->next->is_menu_item()) ? q->next->level : 
next->level+1;
+       nItem += 1 + ((thislevel > nextlevel) ? (thislevel-nextlevel) : 0);
       }
       if (nLabel) {
         write_c("%sif (!%s_i18n_done) {\n", indent(), mName);

_______________________________________________
fltk-commit mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-commit

Reply via email to