Bug 510333, native resizer theming for Cocoa, r=mstange

This commit is contained in:
Neil Deakin 2009-08-20 10:19:18 -04:00
parent fb91ae4918
commit 808de8ae84
2 changed files with 25 additions and 0 deletions

View File

@ -17,6 +17,7 @@ resizer[dir="topleft"] {
resizer[dir="bottomright"],
resizer[dir="bottomend"]:-moz-locale-dir(ltr) {
cursor: se-resize;
-moz-appearance: resizer;
}
resizer[dir="topright"] {

View File

@ -1862,6 +1862,16 @@ nsNativeThemeCocoa::DrawWidgetBackground(nsIRenderingContext* aContext, nsIFrame
case NS_THEME_TAB_PANELS:
DrawTabPanel(cgContext, macRect, aFrame);
break;
case NS_THEME_RESIZER:
HIThemeGrowBoxDrawInfo drawInfo;
drawInfo.version = 0;
drawInfo.state = kThemeStateActive;
drawInfo.kind = kHIThemeGrowBoxKindNormal;
drawInfo.direction = kThemeGrowRight | kThemeGrowDown;
drawInfo.size = kHIThemeGrowBoxSizeNormal;
HIThemeDrawGrowBox(&macRect.origin, &drawInfo, cgContext, kHIThemeOrientationNormal);
break;
}
nativeDrawing.EndNativeDrawing();
@ -2247,6 +2257,19 @@ nsNativeThemeCocoa::GetMinimumWidgetSize(nsIRenderingContext* aContext,
*aIsOverridable = PR_FALSE;
break;
}
case NS_THEME_RESIZER:
{
HIThemeGrowBoxDrawInfo drawInfo;
drawInfo.version = 0;
drawInfo.state = kThemeStateActive;
drawInfo.kind = kHIThemeGrowBoxKindNormal;
drawInfo.direction = kThemeGrowRight | kThemeGrowDown;
drawInfo.size = kHIThemeGrowBoxSizeNormal;
HIPoint pnt = { 0, 0 };
HIRect bounds;
HIThemeGetGrowBoxBounds(&pnt, &drawInfo, &bounds);
aResult->SizeTo(bounds.size.width, bounds.size.height);
}
}
return NS_OK;
@ -2343,6 +2366,7 @@ nsNativeThemeCocoa::ThemeSupportsWidget(nsPresContext* aPresContext, nsIFrame* a
case NS_THEME_MENUITEM:
case NS_THEME_MENUSEPARATOR:
case NS_THEME_TOOLTIP:
case NS_THEME_RESIZER:
case NS_THEME_CHECKBOX:
case NS_THEME_CHECKBOX_CONTAINER: