зеркало из https://github.com/mozilla/pjs.git
Bug 634088 - Use native rendering for indeterminate progress bar for Cocoa. r=mstange,roc
This commit is contained in:
Родитель
4fe6a88038
Коммит
6cf6f4976a
|
@ -1759,13 +1759,13 @@ nsNativeThemeCocoa::DrawWidgetBackground(nsRenderingContext* aContext,
|
|||
if (!QueueAnimatedContentForRefresh(aFrame->GetContent(), 30)) {
|
||||
NS_WARNING("Unable to animate progressbar!");
|
||||
}
|
||||
DrawProgress(cgContext, macRect, IsIndeterminateProgress(aFrame),
|
||||
DrawProgress(cgContext, macRect, IsIndeterminateProgress(aFrame, eventState),
|
||||
PR_TRUE, GetProgressValue(aFrame),
|
||||
GetProgressMaxValue(aFrame), aFrame);
|
||||
break;
|
||||
|
||||
case NS_THEME_PROGRESSBAR_VERTICAL:
|
||||
DrawProgress(cgContext, macRect, IsIndeterminateProgress(aFrame),
|
||||
DrawProgress(cgContext, macRect, IsIndeterminateProgress(aFrame, eventState),
|
||||
PR_FALSE, GetProgressValue(aFrame),
|
||||
GetProgressMaxValue(aFrame), aFrame);
|
||||
break;
|
||||
|
|
|
@ -457,11 +457,16 @@ nsNativeTheme::IsNextToSelectedTab(nsIFrame* aFrame, PRInt32 aOffset)
|
|||
|
||||
// progressbar:
|
||||
PRBool
|
||||
nsNativeTheme::IsIndeterminateProgress(nsIFrame* aFrame)
|
||||
nsNativeTheme::IsIndeterminateProgress(nsIFrame* aFrame,
|
||||
nsEventStates aEventStates)
|
||||
{
|
||||
if (!aFrame)
|
||||
return PR_FALSE;
|
||||
|
||||
if (aFrame->GetContent()->IsHTML(nsWidgetAtoms::progress)) {
|
||||
return aEventStates.HasState(NS_EVENT_STATE_INDETERMINATE);
|
||||
}
|
||||
|
||||
return aFrame->GetContent()->AttrValueIs(kNameSpaceID_None, nsWidgetAtoms::mode,
|
||||
NS_LITERAL_STRING("undetermined"),
|
||||
eCaseMatters);
|
||||
|
|
|
@ -160,7 +160,7 @@ class nsNativeTheme : public nsITimerCallback
|
|||
PRBool IsHorizontal(nsIFrame* aFrame);
|
||||
|
||||
// progressbar:
|
||||
PRBool IsIndeterminateProgress(nsIFrame* aFrame);
|
||||
PRBool IsIndeterminateProgress(nsIFrame* aFrame, nsEventStates aEventStates);
|
||||
|
||||
PRInt32 GetProgressValue(nsIFrame* aFrame) {
|
||||
return CheckIntAttr(aFrame, nsWidgetAtoms::value, 0);
|
||||
|
|
|
@ -104,6 +104,7 @@ WIDGET_ATOM(open, "open") // Whether or not a menu, tree, etc. is open
|
|||
WIDGET_ATOM(orient, "orient")
|
||||
WIDGET_ATOM(pageincrement, "pageincrement")
|
||||
WIDGET_ATOM(parentfocused, "parentfocused")
|
||||
WIDGET_ATOM(progress, "progress")
|
||||
WIDGET_ATOM(radio, "radio")
|
||||
WIDGET_ATOM(readonly, "readonly")
|
||||
WIDGET_ATOM(Reload, "Reload")
|
||||
|
|
Загрузка…
Ссылка в новой задаче