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