From b4728af8b2c26813835f71dbcee4c13edea0b874 Mon Sep 17 00:00:00 2001 From: Mounir Lamouri Date: Tue, 1 Jun 2010 11:53:47 +1200 Subject: [PATCH] Bug 569216. Render Cocoa progressbars using RenderTransformedHIThemeControl. r=mstange --- widget/src/cocoa/nsNativeThemeCocoa.mm | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/widget/src/cocoa/nsNativeThemeCocoa.mm b/widget/src/cocoa/nsNativeThemeCocoa.mm index 2c08f4170c49..b4774ceee90e 100644 --- a/widget/src/cocoa/nsNativeThemeCocoa.mm +++ b/widget/src/cocoa/nsNativeThemeCocoa.mm @@ -1016,6 +1016,14 @@ nsNativeThemeCocoa::DrawFrame(CGContextRef cgContext, HIThemeFrameKind inKind, NS_OBJC_END_TRY_ABORT_BLOCK; } +static void +RenderProgress(CGContextRef cgContext, const HIRect& aRenderRect, void* aData) +{ + HIThemeTrackDrawInfo* tdi = (HIThemeTrackDrawInfo*)aData; + tdi->bounds = aRenderRect; + HIThemeDrawTrack(tdi, NULL, cgContext, kHIThemeOrientationNormal); +} + void nsNativeThemeCocoa::DrawProgress(CGContextRef cgContext, const HIRect& inBoxRect, PRBool inIsIndeterminate, PRBool inIsHorizontal, @@ -1040,7 +1048,8 @@ nsNativeThemeCocoa::DrawProgress(CGContextRef cgContext, const HIRect& inBoxRect tdi.trackInfo.progress.phase = PR_IntervalToMilliseconds(PR_IntervalNow()) / milliSecondsPerStep % 16; - HIThemeDrawTrack(&tdi, NULL, cgContext, HITHEME_ORIENTATION); + RenderTransformedHIThemeControl(cgContext, inBoxRect, RenderProgress, &tdi, + IsFrameRTL(aFrame)); NS_OBJC_END_TRY_ABORT_BLOCK; }