Changeset 25948

Show
Ignore:
Timestamp:
06/12/08 20:24:01 (5 months ago)
Author:
aldeck
Message:

- BMenu caches the preferred size (since r21396) but didn't recompute it if the ResizingMode changed, it did it only in
InvalidateLayout().

This fixes #1461, the bug appeared because DraggableContainerIcon uses a special trick, involving changing the resizing

mode, to get the total width of the menu items. (see tracker/ContainerWindow.cpp line 479)

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • haiku/trunk/src/kits/interface/Menu.cpp

    r24911 r25948  
    174174struct BMenu::LayoutData { 
    175175        BSize   preferred; 
     176        uint32  lastResizingMode; 
    176177}; 
    177178 
     
    18541855BMenu::_ValidatePreferredSize() 
    18551856{ 
    1856         if (!fLayoutData->preferred.IsWidthSet()) 
     1857        if (!fLayoutData->preferred.IsWidthSet() || ResizingMode() != fLayoutData->lastResizingMode)             
    18571858                _ComputeLayout(0, true, false, NULL, NULL); 
    18581859 
     
    18681869        // Recalculate only the needed items, 
    18691870        // not the whole layout every time 
     1871         
     1872        fLayoutData->lastResizingMode = ResizingMode(); 
    18701873 
    18711874        BRect frame;