followup for 370659, all popups started overflowing because we were assigning overflow to too many widgets. Thanks to Mano for figuring out what the problem was. b=370769 r=cbarrett

This commit is contained in:
joshmoz%gmail.com 2007-02-20 19:33:20 +00:00
Родитель efb4fb3c6e
Коммит 9d4c54fa82
1 изменённых файлов: 26 добавлений и 12 удалений

Просмотреть файл

@ -721,18 +721,32 @@ PRBool
nsNativeThemeCocoa::GetWidgetOverflow(nsIDeviceContext* aContext, nsIFrame* aFrame,
PRUint8 aWidgetType, nsRect* aResult)
{
// We assume that all native widgets can draw a focus ring that will be less than
// or equal to 4 pixels thick.
nsIntMargin extraSize = nsIntMargin(4, 4, 4, 4);
PRInt32 p2a = aContext->AppUnitsPerDevPixel();
nsMargin m(NSIntPixelsToAppUnits(extraSize.left, p2a),
NSIntPixelsToAppUnits(extraSize.top, p2a),
NSIntPixelsToAppUnits(extraSize.right, p2a),
NSIntPixelsToAppUnits(extraSize.bottom, p2a));
nsRect r(nsPoint(0, 0), aFrame->GetSize());
r.Inflate(m);
*aResult = r;
return PR_TRUE;
switch (aWidgetType) {
case NS_THEME_BUTTON:
case NS_THEME_BUTTON_SMALL:
case NS_THEME_TEXTFIELD:
case NS_THEME_LISTBOX:
case NS_THEME_DROPDOWN:
case NS_THEME_DROPDOWN_BUTTON:
case NS_THEME_CHECKBOX:
case NS_THEME_CHECKBOX_SMALL:
case NS_THEME_RADIO:
case NS_THEME_RADIO_SMALL:
// We assume that the above widgets can draw a focus ring that will be less than
// or equal to 4 pixels thick.
nsIntMargin extraSize = nsIntMargin(4, 4, 4, 4);
PRInt32 p2a = aContext->AppUnitsPerDevPixel();
nsMargin m(NSIntPixelsToAppUnits(extraSize.left, p2a),
NSIntPixelsToAppUnits(extraSize.top, p2a),
NSIntPixelsToAppUnits(extraSize.right, p2a),
NSIntPixelsToAppUnits(extraSize.bottom, p2a));
nsRect r(nsPoint(0, 0), aFrame->GetSize());
r.Inflate(m);
*aResult = r;
return PR_TRUE;
}
return PR_FALSE;
}
NS_IMETHODIMP