Bug 751437 - Extend overflow rect in Cocoa progress bars. r=mstange

This commit is contained in:
Reuben Morais 2012-05-05 12:41:50 -04:00
Родитель 4823e7c3e4
Коммит 0cd2da2404
1 изменённых файлов: 8 добавлений и 1 удалений

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

@ -2387,6 +2387,7 @@ bool
nsNativeThemeCocoa::GetWidgetOverflow(nsDeviceContext* aContext, nsIFrame* aFrame,
PRUint8 aWidgetType, nsRect* aOverflowRect)
{
PRInt32 p2a = aContext->AppUnitsPerDevPixel();
switch (aWidgetType) {
case NS_THEME_BUTTON:
case NS_THEME_TOOLBAR_BUTTON:
@ -2404,7 +2405,6 @@ nsNativeThemeCocoa::GetWidgetOverflow(nsDeviceContext* aContext, nsIFrame* aFram
// 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(MAX_FOCUS_RING_WIDTH, MAX_FOCUS_RING_WIDTH, MAX_FOCUS_RING_WIDTH, MAX_FOCUS_RING_WIDTH);
PRInt32 p2a = aContext->AppUnitsPerDevPixel();
nsMargin m(NSIntPixelsToAppUnits(extraSize.left, p2a),
NSIntPixelsToAppUnits(extraSize.top, p2a),
NSIntPixelsToAppUnits(extraSize.right, p2a),
@ -2412,6 +2412,13 @@ nsNativeThemeCocoa::GetWidgetOverflow(nsDeviceContext* aContext, nsIFrame* aFram
aOverflowRect->Inflate(m);
return true;
}
case NS_THEME_PROGRESSBAR:
{
// Progress bars draw a 2 pixel white shadow under their progress indicators
nsMargin m(0, 0, 0, NSIntPixelsToAppUnits(2, p2a));
aOverflowRect->Inflate(m);
return true;
}
}
return false;