allow full styling of comboboxes on Mac OS X. b=381647 r=cbarrett sr=roc
git-svn-id: svn://10.0.0.236/trunk@233186 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
f607b61810
commit
e2ea16f4b6
@ -1376,9 +1376,18 @@ nsNativeThemeCocoa::ThemeSupportsWidget(nsPresContext* aPresContext, nsIFrame* a
|
||||
if (aPresContext && !aPresContext->PresShell()->IsThemeSupportEnabled())
|
||||
return PR_FALSE;
|
||||
|
||||
PRBool retVal = PR_FALSE;
|
||||
// if this is a dropdown button in a combobox the answer is always no
|
||||
if (aWidgetType == NS_THEME_DROPDOWN_BUTTON) {
|
||||
nsIFrame* parentFrame = aFrame->GetParent();
|
||||
if (parentFrame && (parentFrame->GetType() == nsWidgetAtoms::comboboxControlFrame))
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
switch (aWidgetType) {
|
||||
case NS_THEME_LISTBOX:
|
||||
return PR_TRUE; // we always want listboxes themed, non-themed ones look wrong
|
||||
break;
|
||||
|
||||
case NS_THEME_DIALOG:
|
||||
case NS_THEME_WINDOW:
|
||||
case NS_THEME_MENUPOPUP:
|
||||
@ -1435,19 +1444,15 @@ nsNativeThemeCocoa::ThemeSupportsWidget(nsPresContext* aPresContext, nsIFrame* a
|
||||
case NS_THEME_SCROLLBAR_THUMB_VERTICAL:
|
||||
case NS_THEME_SCROLLBAR_TRACK_VERTICAL:
|
||||
case NS_THEME_SCROLLBAR_TRACK_HORIZONTAL:
|
||||
retVal = PR_TRUE;
|
||||
break;
|
||||
|
||||
case NS_THEME_LISTBOX:
|
||||
case NS_THEME_DROPDOWN:
|
||||
case NS_THEME_DROPDOWN_BUTTON:
|
||||
case NS_THEME_DROPDOWN_TEXT:
|
||||
// Support listboxes and dropdowns regardless of styling,
|
||||
// since non-themed ones look totally wrong.
|
||||
return PR_TRUE;
|
||||
return !IsWidgetStyled(aPresContext, aFrame, aWidgetType);
|
||||
break;
|
||||
}
|
||||
|
||||
return retVal ? !IsWidgetStyled(aPresContext, aFrame, aWidgetType) : PR_FALSE;
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -64,6 +64,7 @@ WIDGET_ATOM(checkbox, "checkbox")
|
||||
WIDGET_ATOM(checked, "checked")
|
||||
WIDGET_ATOM(_class, "class")
|
||||
WIDGET_ATOM(collapsed, "collapsed")
|
||||
WIDGET_ATOM(comboboxControlFrame, "ComboboxControlFrame")
|
||||
WIDGET_ATOM(command, "command")
|
||||
WIDGET_ATOM(curpos, "curpos")
|
||||
WIDGET_ATOM(_default, "default")
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user