Find: set a max width on each of the menu fields

... instead of the just on the mime type menu now that
menu field truncation is working. This will prevent the
volume menu growing too wide as well.
This commit is contained in:
John Scipione 2013-05-06 17:23:59 -04:00
parent c333966291
commit 13cec30211
1 changed files with 3 additions and 4 deletions

View File

@ -862,9 +862,7 @@ FindPanel::FindPanel(BFile* node, FindWindow* parent, bool fromTemplate,
else
AddByAttributeItems(node);
fMimeTypeField->SetExplicitSize(
BSize(be_control_look->DefaultItemSpacing() * 20, B_SIZE_UNSET));
// ResizeMenuField() makes fMimeTypeField too wide.
ResizeMenuField(fMimeTypeField);
ResizeMenuField(searchModeField);
ResizeMenuField(volumeField);
}
@ -972,7 +970,8 @@ FindPanel::ResizeMenuField(BMenuField* menuField)
}
}
size.width = width + padding;
float maxWidth = be_control_look->DefaultItemSpacing() * 20;
size.width = std::min(width + padding, maxWidth);
menuField->SetExplicitSize(size);
}