titler rework, some code cleanup and fixes
[goodguy/history.git] / cinelerra-5.1 / guicast / bclistbox.C
index 683985feec863488fb4969639fef2f083d1423cb..76f8fde1eee13f042d592db2f3f2793977d4bda1 100644 (file)
@@ -732,9 +732,10 @@ void BC_ListBox::calculate_last_coords_recursive(
 // Lowest right icon coordinate.
                                current_icon_x = item->icon_x;
                                if(current_icon_x > *icon_x) *icon_x = current_icon_x;
-                               if(current_icon_x + get_item_w(item) > *next_icon_x)
+                               if(current_icon_x + get_item_w(item) > *next_icon_x) {
                                        *next_icon_x = current_icon_x + get_item_w(item);
-
+                                       *next_icon_y = 0;
+                               }
                                current_icon_y = item->icon_y + get_item_h(item);
                                if(current_icon_y > *next_icon_y)
                                        *next_icon_y = current_icon_y;
@@ -1129,8 +1130,8 @@ int BC_ListBox::get_items_height(ArrayList<BC_ListBoxItem*> *data,
                int x, y, w, h;
                BC_ListBoxItem *item = data[master_column].values[j];
 
-               if(display_format == LISTBOX_ICONS)
-               {
+               if( display_format == LISTBOX_ICONS ||
+                   display_format == LISTBOX_ICON_LIST ) {
                        get_icon_mask(item, x, y, w, h);
                        if(y + h + yposition > highest) highest = y + h + yposition;
 
@@ -1141,8 +1142,6 @@ int BC_ListBox::get_items_height(ArrayList<BC_ListBoxItem*> *data,
                {
                        get_text_mask(item, x, y, w, h);
                        *result += h;
-
-
 // Descend into sublist
                        if(item->get_sublist() &&
                                item->get_expand())
@@ -1154,9 +1153,7 @@ int BC_ListBox::get_items_height(ArrayList<BC_ListBoxItem*> *data,
                }
        }
 
-       if((display_format == LISTBOX_TEXT ||
-               display_format == LISTBOX_ICON_LIST) &&
-               top_level)
+       if( display_format == LISTBOX_TEXT && top_level )
        {
                highest = LISTBOX_MARGIN + *result;
        }