mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 22:01:30 +00:00
Bug 1028716 part 3 - Widget updates to support the extended set of -moz-orient values. r=roc
This commit is contained in:
parent
b68965af5a
commit
3ffbad09c7
@ -2672,7 +2672,7 @@ nsNativeThemeCocoa::DrawWidgetBackground(nsRenderingContext* aContext,
|
||||
}
|
||||
}
|
||||
DrawProgress(cgContext, macRect, IsIndeterminateProgress(aFrame, eventState),
|
||||
aFrame->StyleDisplay()->mOrient != NS_STYLE_ORIENT_VERTICAL,
|
||||
!IsVerticalProgress(aFrame),
|
||||
value, maxValue, aFrame);
|
||||
break;
|
||||
}
|
||||
|
@ -597,7 +597,7 @@ nsNativeThemeGTK::GetGtkWidgetAndState(uint8_t aWidgetType, nsIFrame* aFrame,
|
||||
EventStates eventStates = GetContentState(stateFrame, aWidgetType);
|
||||
|
||||
aGtkWidgetType = IsIndeterminateProgress(stateFrame, eventStates)
|
||||
? (stateFrame->StyleDisplay()->mOrient == NS_STYLE_ORIENT_VERTICAL)
|
||||
? IsVerticalProgress(stateFrame)
|
||||
? MOZ_GTK_PROGRESS_CHUNK_VERTICAL_INDETERMINATE
|
||||
: MOZ_GTK_PROGRESS_CHUNK_INDETERMINATE
|
||||
: MOZ_GTK_PROGRESS_CHUNK;
|
||||
|
@ -557,15 +557,28 @@ nsNativeTheme::IsIndeterminateProgress(nsIFrame* aFrame,
|
||||
bool
|
||||
nsNativeTheme::IsVerticalProgress(nsIFrame* aFrame)
|
||||
{
|
||||
return aFrame &&
|
||||
aFrame->StyleDisplay()->mOrient == NS_STYLE_ORIENT_VERTICAL;
|
||||
if (!aFrame) {
|
||||
return false;
|
||||
}
|
||||
return IsVerticalMeter(aFrame);
|
||||
}
|
||||
|
||||
bool
|
||||
nsNativeTheme::IsVerticalMeter(nsIFrame* aFrame)
|
||||
{
|
||||
NS_PRECONDITION(aFrame, "You have to pass a non-null aFrame");
|
||||
return aFrame->StyleDisplay()->mOrient == NS_STYLE_ORIENT_VERTICAL;
|
||||
switch (aFrame->StyleDisplay()->mOrient) {
|
||||
case NS_STYLE_ORIENT_HORIZONTAL:
|
||||
return false;
|
||||
case NS_STYLE_ORIENT_VERTICAL:
|
||||
return true;
|
||||
case NS_STYLE_ORIENT_INLINE:
|
||||
return aFrame->GetWritingMode().IsVertical();
|
||||
case NS_STYLE_ORIENT_BLOCK:
|
||||
return !aFrame->GetWritingMode().IsVertical();
|
||||
}
|
||||
NS_NOTREACHED("unexpected -moz-orient value");
|
||||
return false;
|
||||
}
|
||||
|
||||
// menupopup:
|
||||
|
Loading…
Reference in New Issue
Block a user