make widgets appear inactive when they are backgrounded. patch by Markus Stange. b=54488 r=josh sr=roc a=schrep

This commit is contained in:
joshmoz@gmail.com 2008-05-07 15:22:33 -07:00
Родитель b63056a1c2
Коммит a1ccc68144
3 изменённых файлов: 136 добавлений и 74 удалений

Просмотреть файл

@ -2495,6 +2495,9 @@ NSEvent* gLastDragEvent = nil;
nsGUIEvent focusGuiEvent(PR_TRUE, eventType, mGeckoChild);
focusGuiEvent.time = PR_IntervalNow();
mGeckoChild->DispatchEvent(&focusGuiEvent, status);
// invalidate so that things with a different appearance in background windows will redraw
mGeckoChild->Invalidate(PR_FALSE);
}

Просмотреть файл

@ -95,37 +95,38 @@ protected:
nsresult GetSystemFont(PRUint8 aWidgetType, nsSystemFontID& aFont);
// HITheme drawing routines
void DrawFrame (CGContextRef context, HIThemeFrameKind inKind,
const HIRect& inBoxRect, PRBool inIsDisabled,
PRInt32 inState);
void DrawFrame(CGContextRef context, HIThemeFrameKind inKind,
const HIRect& inBoxRect, PRBool inIsDisabled,
PRInt32 inState);
void DrawProgress(CGContextRef context, const HIRect& inBoxRect,
PRBool inIsIndeterminate, PRBool inIsHorizontal,
PRInt32 inValue);
void DrawTab (CGContextRef context, const HIRect& inBoxRect,
PRBool inIsDisabled, PRBool inIsFrontmost,
PRBool inIsHorizontal, PRBool inTabBottom,
PRInt32 inState);
void DrawTabPanel (CGContextRef context, const HIRect& inBoxRect);
void DrawScale (CGContextRef context, const HIRect& inBoxRect,
PRBool inIsDisabled, PRInt32 inState,
PRBool inDirection, PRBool inIsReverse,
PRInt32 inCurrentValue,
PRInt32 inMinValue, PRInt32 inMaxValue);
PRInt32 inValue, nsIFrame* aFrame);
void DrawTab(CGContextRef context, const HIRect& inBoxRect,
PRBool inIsDisabled, PRBool inIsFrontmost,
PRBool inIsHorizontal, PRBool inTabBottom,
PRInt32 inState, nsIFrame* aFrame);
void DrawTabPanel(CGContextRef context, const HIRect& inBoxRect, nsIFrame* aFrame);
void DrawScale(CGContextRef context, const HIRect& inBoxRect,
PRBool inIsDisabled, PRInt32 inState,
PRBool inDirection, PRBool inIsReverse,
PRInt32 inCurrentValue,
PRInt32 inMinValue, PRInt32 inMaxValue, nsIFrame* aFrame);
void DrawRadioButton(CGContextRef cgContext, const HIRect& inBoxRect, PRBool inSelected,
PRBool inDisabled, PRInt32 inState);
PRBool inDisabled, PRInt32 inState, nsIFrame* aFrame);
void DrawPushButton(CGContextRef cgContext, const HIRect& inBoxRect, PRBool inIsDefault,
PRBool inDisabled, PRInt32 inState);
void DrawButton (CGContextRef context, ThemeButtonKind inKind,
const HIRect& inBoxRect, PRBool inIsDefault,
PRBool inDisabled, ThemeButtonValue inValue,
ThemeButtonAdornment inAdornment, PRInt32 inState);
void DrawSpinButtons (CGContextRef context, ThemeButtonKind inKind,
const HIRect& inBoxRect,
PRBool inDisabled, ThemeDrawState inDrawState,
ThemeButtonAdornment inAdornment, PRInt32 inState);
PRBool inDisabled, PRInt32 inState, nsIFrame* aFrame);
void DrawButton(CGContextRef context, ThemeButtonKind inKind,
const HIRect& inBoxRect, PRBool inIsDefault,
PRBool inDisabled, ThemeButtonValue inValue,
ThemeButtonAdornment inAdornment, PRInt32 inState,
nsIFrame* aFrame);
void DrawSpinButtons(CGContextRef context, ThemeButtonKind inKind,
const HIRect& inBoxRect, PRBool inDisabled,
ThemeDrawState inDrawState, ThemeButtonAdornment inAdornment,
PRInt32 inState, nsIFrame* aFrame);
void DrawCheckbox(CGContextRef context, ThemeButtonKind inKind,
const HIRect& inBoxRect, PRBool inChecked,
PRBool inDisabled, PRInt32 inState);
PRBool inDisabled, PRInt32 inState, nsIFrame* aFrame);
// Scrollbars
void DrawScrollbar(CGContextRef aCGContext, const HIRect& aBoxRect, nsIFrame *aFrame);
void GetScrollbarPressStates (nsIFrame *aFrame, PRInt32 aButtonStates[]);

Просмотреть файл

@ -57,6 +57,7 @@
#include "nsILookAndFeel.h"
#include "nsWidgetAtoms.h"
#include "nsToolkit.h"
#include "nsIWidget.h"
#include "gfxContext.h"
#include "gfxQuartzSurface.h"
@ -146,26 +147,54 @@ nsNativeThemeCocoa::~nsNativeThemeCocoa()
NS_OBJC_END_TRY_ABORT_BLOCK;
}
static BOOL frameIsInActiveWindow(nsIFrame* aFrame)
{
// default return value should be YES here, so things are painted as active by default
if (!aFrame)
return YES;
nsIWidget* widget = aFrame->GetWindow();
if (!widget)
return YES;
// get the top-level widget
nsIWidget* topLevelWidget;
while (widget) {
topLevelWidget = widget;
widget = widget->GetParent();
}
NSWindow* nativeWindow = (NSWindow*)topLevelWidget->GetNativeData(NS_NATIVE_WINDOW);
if (!nativeWindow)
return YES;
nsWindowType windowType;
topLevelWidget->GetWindowType(windowType);
return [nativeWindow isKeyWindow] || (windowType == eWindowType_popup);
}
void
nsNativeThemeCocoa::DrawCheckbox(CGContextRef cgContext, ThemeButtonKind inKind,
const HIRect& inBoxRect, PRBool inChecked,
PRBool inDisabled, PRInt32 inState)
PRBool inDisabled, PRInt32 inState, nsIFrame* aFrame)
{
NS_OBJC_BEGIN_TRY_ABORT_BLOCK;
HIThemeButtonDrawInfo bdi;
bdi.version = 0;
bdi.kind = inKind;
BOOL isInActiveWindow = frameIsInActiveWindow(aFrame);
if (inDisabled)
bdi.state = kThemeStateUnavailable;
else if ((inState & NS_EVENT_STATE_ACTIVE) && (inState & NS_EVENT_STATE_HOVER))
bdi.state = kThemeStatePressed;
else
bdi.state = kThemeStateActive;
bdi.state = isInActiveWindow ? kThemeStateActive : kThemeStateInactive;
bdi.value = inChecked ? kThemeButtonOn : kThemeButtonOff;
bdi.adornment = (inState & NS_EVENT_STATE_FOCUS) ? kThemeAdornmentFocus : kThemeAdornmentNone;
bdi.adornment = (inState & NS_EVENT_STATE_FOCUS && isInActiveWindow) ? kThemeAdornmentFocus : kThemeAdornmentNone;
HIRect drawFrame = inBoxRect;
@ -317,7 +346,7 @@ nsNativeThemeCocoa::DrawCellWithScaling(NSCell *cell,
NS_OBJC_END_TRY_ABORT_BLOCK;
}
// These are the sizes that Gecko needs to request to draw if it wants
// to get a standard-sized Aqua radio button drawn. Note that the rects
// that draw these are actually a little bigger.
@ -345,13 +374,13 @@ static const float radioButtonMargins[2][3][4] =
void
nsNativeThemeCocoa::DrawRadioButton(CGContextRef cgContext, const HIRect& inBoxRect, PRBool inSelected,
PRBool inDisabled, PRInt32 inState)
PRBool inDisabled, PRInt32 inState, nsIFrame* aFrame)
{
NS_OBJC_BEGIN_TRY_ABORT_BLOCK;
NSRect drawRect = NSMakeRect(inBoxRect.origin.x, inBoxRect.origin.y, inBoxRect.size.width, inBoxRect.size.height);
[mRadioButtonCell setEnabled:!inDisabled];
[mRadioButtonCell setEnabled:(!inDisabled && frameIsInActiveWindow(aFrame))];
[mRadioButtonCell setShowsFirstResponder:(inState & NS_EVENT_STATE_FOCUS)];
[mRadioButtonCell setState:(inSelected ? NSOnState : NSOffState)];
[mRadioButtonCell setHighlighted:((inState & NS_EVENT_STATE_ACTIVE) && (inState & NS_EVENT_STATE_HOVER))];
@ -403,15 +432,20 @@ static const float pushButtonMargins[2][3][4] =
void
nsNativeThemeCocoa::DrawPushButton(CGContextRef cgContext, const HIRect& inBoxRect, PRBool inIsDefault,
PRBool inDisabled, PRInt32 inState)
PRBool inDisabled, PRInt32 inState, nsIFrame* aFrame)
{
NS_OBJC_BEGIN_TRY_ABORT_BLOCK;
NSRect drawRect = NSMakeRect(inBoxRect.origin.x, inBoxRect.origin.y, inBoxRect.size.width, inBoxRect.size.height);
BOOL isInActiveWindow = frameIsInActiveWindow(aFrame);
[mPushButtonCell setEnabled:!inDisabled];
[mPushButtonCell setHighlighted:((inState & NS_EVENT_STATE_ACTIVE) && (inState & NS_EVENT_STATE_HOVER) || (inIsDefault && !inDisabled))];
[mPushButtonCell setShowsFirstResponder:(inState & NS_EVENT_STATE_FOCUS)];
[mPushButtonCell setHighlighted:(((inState & NS_EVENT_STATE_ACTIVE) &&
(inState & NS_EVENT_STATE_HOVER) ||
(inIsDefault && !inDisabled)) &&
isInActiveWindow)];
[mPushButtonCell setShowsFirstResponder:(inState & NS_EVENT_STATE_FOCUS) && !inDisabled && isInActiveWindow];
CGAffineTransform savedCTM = CGContextGetCTM(cgContext);
@ -475,7 +509,7 @@ void
nsNativeThemeCocoa::DrawButton(CGContextRef cgContext, ThemeButtonKind inKind,
const HIRect& inBoxRect, PRBool inIsDefault, PRBool inDisabled,
ThemeButtonValue inValue, ThemeButtonAdornment inAdornment,
PRInt32 inState)
PRInt32 inState, nsIFrame* aFrame)
{
NS_OBJC_BEGIN_TRY_ABORT_BLOCK;
@ -485,12 +519,18 @@ nsNativeThemeCocoa::DrawButton(CGContextRef cgContext, ThemeButtonKind inKind,
bdi.value = inValue;
bdi.adornment = inAdornment;
if (inDisabled)
if (inDisabled) {
bdi.state = kThemeStateUnavailable;
else if ((inState & NS_EVENT_STATE_ACTIVE) && (inState & NS_EVENT_STATE_HOVER))
}
else if ((inState & NS_EVENT_STATE_ACTIVE) && (inState & NS_EVENT_STATE_HOVER)) {
bdi.state = kThemeStatePressed;
else
bdi.state = (inKind == kThemeArrowButton) ? kThemeStateUnavailable : kThemeStateActive;
}
else {
if (inKind == kThemeArrowButton)
bdi.state = kThemeStateUnavailable; // these are always drawn as unavailable
else
bdi.state = frameIsInActiveWindow(aFrame) ? kThemeStateActive : kThemeStateInactive;
}
if (inState & NS_EVENT_STATE_FOCUS)
bdi.adornment |= kThemeAdornmentFocus;
@ -602,7 +642,7 @@ nsNativeThemeCocoa::DrawSpinButtons(CGContextRef cgContext, ThemeButtonKind inKi
const HIRect& inBoxRect, PRBool inDisabled,
ThemeDrawState inDrawState,
ThemeButtonAdornment inAdornment,
PRInt32 inState)
PRInt32 inState, nsIFrame* aFrame)
{
NS_OBJC_BEGIN_TRY_ABORT_BLOCK;
@ -615,6 +655,8 @@ nsNativeThemeCocoa::DrawSpinButtons(CGContextRef cgContext, ThemeButtonKind inKi
if (inDisabled)
bdi.state = kThemeStateUnavailable;
else
bdi.state = frameIsInActiveWindow(aFrame) ? kThemeStateActive : kThemeStateInactive;
HIThemeDrawButton(&inBoxRect, &bdi, cgContext, HITHEME_ORIENTATION, NULL);
@ -624,14 +666,19 @@ nsNativeThemeCocoa::DrawSpinButtons(CGContextRef cgContext, ThemeButtonKind inKi
void
nsNativeThemeCocoa::DrawFrame(CGContextRef cgContext, HIThemeFrameKind inKind,
const HIRect& inBoxRect, PRBool inIsDisabled, PRInt32 inState)
const HIRect& inBoxRect, PRBool inIsDisabled,
PRInt32 inState)
{
NS_OBJC_BEGIN_TRY_ABORT_BLOCK;
HIThemeFrameDrawInfo fdi;
fdi.version = 0;
fdi.kind = inKind;
// We don't ever set an inactive state for this because it doesn't
// look right(see other apps).
fdi.state = inIsDisabled ? kThemeStateUnavailable : kThemeStateActive;
// for some reason focus rings on listboxes draw incorrectly
if (inKind == kHIThemeFrameListBox)
fdi.isFocused = 0;
@ -671,9 +718,9 @@ nsNativeThemeCocoa::DrawFrame(CGContextRef cgContext, HIThemeFrameKind inKind,
void
nsNativeThemeCocoa::DrawProgress(CGContextRef cgContext,
const HIRect& inBoxRect, PRBool inIsIndeterminate,
PRBool inIsHorizontal, PRInt32 inValue)
nsNativeThemeCocoa::DrawProgress(CGContextRef cgContext, const HIRect& inBoxRect,
PRBool inIsIndeterminate, PRBool inIsHorizontal,
PRInt32 inValue, nsIFrame* aFrame)
{
NS_OBJC_BEGIN_TRY_ABORT_BLOCK;
@ -689,7 +736,7 @@ nsNativeThemeCocoa::DrawProgress(CGContextRef cgContext,
tdi.max = 100;
tdi.value = inValue;
tdi.attributes = inIsHorizontal ? kThemeTrackHorizontal : 0;
tdi.enableState = kThemeTrackActive;
tdi.enableState = frameIsInActiveWindow(aFrame) ? kThemeTrackActive : kThemeTrackInactive;
tdi.trackInfo.progress.phase = PR_IntervalToMilliseconds(PR_IntervalNow()) /
milliSecondsPerStep % 16;
@ -700,14 +747,15 @@ nsNativeThemeCocoa::DrawProgress(CGContextRef cgContext,
void
nsNativeThemeCocoa::DrawTabPanel(CGContextRef cgContext, const HIRect& inBoxRect)
nsNativeThemeCocoa::DrawTabPanel(CGContextRef cgContext, const HIRect& inBoxRect,
nsIFrame* aFrame)
{
NS_OBJC_BEGIN_TRY_ABORT_BLOCK;
HIThemeTabPaneDrawInfo tpdi;
tpdi.version = 0;
tpdi.state = kThemeStateActive;
tpdi.state = frameIsInActiveWindow(aFrame) ? kThemeStateActive : kThemeStateInactive;
tpdi.direction = kThemeTabNorth;
tpdi.size = kHIThemeTabSizeNormal;
@ -721,8 +769,8 @@ void
nsNativeThemeCocoa::DrawScale(CGContextRef cgContext, const HIRect& inBoxRect,
PRBool inIsDisabled, PRInt32 inState,
PRBool inIsVertical, PRBool inIsReverse,
PRInt32 inCurrentValue,
PRInt32 inMinValue, PRInt32 inMaxValue)
PRInt32 inCurrentValue, PRInt32 inMinValue,
PRInt32 inMaxValue, nsIFrame* aFrame)
{
NS_OBJC_BEGIN_TRY_ABORT_BLOCK;
@ -741,7 +789,10 @@ nsNativeThemeCocoa::DrawScale(CGContextRef cgContext, const HIRect& inBoxRect,
tdi.attributes |= kThemeTrackRightToLeft;
if (inState & NS_EVENT_STATE_FOCUS)
tdi.attributes |= kThemeTrackHasFocus;
tdi.enableState = inIsDisabled ? kThemeTrackDisabled : kThemeTrackActive;
if (inIsDisabled)
tdi.enableState = kThemeTrackDisabled;
else
tdi.enableState = frameIsInActiveWindow(aFrame) ? kThemeTrackActive : kThemeTrackInactive;
tdi.trackInfo.slider.thumbDir = kThemeThumbPlain;
tdi.trackInfo.slider.pressState = 0;
@ -755,7 +806,7 @@ void
nsNativeThemeCocoa::DrawTab(CGContextRef cgContext, const HIRect& inBoxRect,
PRBool inIsDisabled, PRBool inIsFrontmost,
PRBool inIsHorizontal, PRBool inTabBottom,
PRInt32 inState)
PRInt32 inState, nsIFrame* aFrame)
{
NS_OBJC_BEGIN_TRY_ABORT_BLOCK;
@ -767,14 +818,14 @@ nsNativeThemeCocoa::DrawTab(CGContextRef cgContext, const HIRect& inBoxRect,
if (inIsDisabled)
tdi.style = kThemeTabFrontUnavailable;
else
tdi.style = kThemeTabFront;
tdi.style = frameIsInActiveWindow(aFrame) ? kThemeTabFront : kThemeTabFrontInactive;
} else {
if (inIsDisabled)
tdi.style = kThemeTabNonFrontUnavailable;
else if ((inState & NS_EVENT_STATE_ACTIVE) && (inState & NS_EVENT_STATE_HOVER))
tdi.style = kThemeTabNonFrontPressed;
else
tdi.style = kThemeTabNonFront;
tdi.style = frameIsInActiveWindow(aFrame) ? kThemeTabNonFront : kThemeTabNonFrontInactive;
}
// don't yet support vertical tabs
@ -862,6 +913,13 @@ nsNativeThemeCocoa::GetScrollbarDrawInfo(HIThemeTrackDrawInfo& aTdi, nsIFrame *a
aTdi.trackInfo.scrollbar.viewsize = (SInt32)thumbSize;
// This should be done early on so things like "kThemeTrackNothingToScroll" can
// override the active enable state.
if (frameIsInActiveWindow(aFrame))
aTdi.enableState = kThemeTrackActive;
else
aTdi.enableState = kThemeTrackInactive;
/* Only display features if we have enough room for them.
* Gecko still maintains the scrollbar info; this is just a visual issue (bug 380185).
*/
@ -1099,26 +1157,26 @@ nsNativeThemeCocoa::DrawWidgetBackground(nsIRenderingContext* aContext, nsIFrame
break;
case NS_THEME_CHECKBOX:
DrawCheckbox(cgContext, kThemeCheckBox, macRect, IsChecked(aFrame), IsDisabled(aFrame), eventState);
DrawCheckbox(cgContext, kThemeCheckBox, macRect, IsChecked(aFrame), IsDisabled(aFrame), eventState, aFrame);
break;
case NS_THEME_CHECKBOX_SMALL:
DrawCheckbox(cgContext, kThemeSmallCheckBox, macRect, IsChecked(aFrame), IsDisabled(aFrame), eventState);
DrawCheckbox(cgContext, kThemeSmallCheckBox, macRect, IsChecked(aFrame), IsDisabled(aFrame), eventState, aFrame);
break;
case NS_THEME_RADIO:
case NS_THEME_RADIO_SMALL:
DrawRadioButton(cgContext, macRect, IsSelected(aFrame), IsDisabled(aFrame), eventState);
DrawRadioButton(cgContext, macRect, IsSelected(aFrame), IsDisabled(aFrame), eventState, aFrame);
break;
case NS_THEME_BUTTON:
DrawPushButton(cgContext, macRect, IsDefaultButton(aFrame), IsDisabled(aFrame), eventState);
DrawPushButton(cgContext, macRect, IsDefaultButton(aFrame), IsDisabled(aFrame), eventState, aFrame);
break;
case NS_THEME_BUTTON_BEVEL:
DrawButton(cgContext, kThemeMediumBevelButton, macRect,
IsDefaultButton(aFrame), IsDisabled(aFrame),
kThemeButtonOff, kThemeAdornmentNone, eventState);
kThemeButtonOff, kThemeAdornmentNone, eventState, aFrame);
break;
case NS_THEME_SPINNER: {
@ -1134,14 +1192,14 @@ nsNativeThemeCocoa::DrawWidgetBackground(nsIRenderingContext* aContext, nsIFrame
}
DrawSpinButtons(cgContext, kThemeIncDecButton, macRect, IsDisabled(aFrame),
state, kThemeAdornmentNone, eventState);
state, kThemeAdornmentNone, eventState, aFrame);
}
break;
case NS_THEME_TOOLBAR_BUTTON:
DrawButton(cgContext, kThemePushButton, macRect,
IsDefaultButton(aFrame), IsDisabled(aFrame),
kThemeButtonOn, kThemeAdornmentNone, eventState);
kThemeButtonOn, kThemeAdornmentNone, eventState, aFrame);
break;
case NS_THEME_TOOLBAR_SEPARATOR: {
@ -1161,13 +1219,13 @@ nsNativeThemeCocoa::DrawWidgetBackground(nsIRenderingContext* aContext, nsIFrame
case NS_THEME_DROPDOWN:
DrawButton(cgContext, kThemePopupButton, macRect,
IsDefaultButton(aFrame), IsDisabled(aFrame),
kThemeButtonOn, kThemeAdornmentNone, eventState);
kThemeButtonOn, kThemeAdornmentNone, eventState, aFrame);
break;
case NS_THEME_DROPDOWN_BUTTON:
DrawButton (cgContext, kThemeArrowButton, macRect, PR_FALSE,
IsDisabled(aFrame), kThemeButtonOn,
kThemeAdornmentArrowDownArrow, eventState);
DrawButton(cgContext, kThemeArrowButton, macRect, PR_FALSE,
IsDisabled(aFrame), kThemeButtonOn,
kThemeAdornmentArrowDownArrow, eventState, aFrame);
break;
case NS_THEME_GROUPBOX: {
@ -1195,12 +1253,12 @@ nsNativeThemeCocoa::DrawWidgetBackground(nsIRenderingContext* aContext, nsIFrame
case NS_THEME_PROGRESSBAR:
DrawProgress(cgContext, macRect, IsIndeterminateProgress(aFrame),
PR_TRUE, GetProgressValue(aFrame));
PR_TRUE, GetProgressValue(aFrame), aFrame);
break;
case NS_THEME_PROGRESSBAR_VERTICAL:
DrawProgress(cgContext, macRect, IsIndeterminateProgress(aFrame),
PR_FALSE, GetProgressValue(aFrame));
PR_FALSE, GetProgressValue(aFrame), aFrame);
break;
case NS_THEME_PROGRESSBAR_CHUNK:
@ -1210,12 +1268,12 @@ nsNativeThemeCocoa::DrawWidgetBackground(nsIRenderingContext* aContext, nsIFrame
case NS_THEME_TREEVIEW_TWISTY:
DrawButton(cgContext, kThemeDisclosureButton, macRect, PR_FALSE, IsDisabled(aFrame),
kThemeDisclosureRight, kThemeAdornmentNone, eventState);
kThemeDisclosureRight, kThemeAdornmentNone, eventState, aFrame);
break;
case NS_THEME_TREEVIEW_TWISTY_OPEN:
DrawButton(cgContext, kThemeDisclosureButton, macRect, PR_FALSE, IsDisabled(aFrame),
kThemeDisclosureDown, kThemeAdornmentNone, eventState);
kThemeDisclosureDown, kThemeAdornmentNone, eventState, aFrame);
break;
case NS_THEME_TREEVIEW_HEADER_CELL: {
@ -1223,7 +1281,7 @@ nsNativeThemeCocoa::DrawWidgetBackground(nsIRenderingContext* aContext, nsIFrame
DrawButton(cgContext, kThemeListHeaderButton, macRect, PR_FALSE, IsDisabled(aFrame),
sortDirection == eTreeSortDirection_Natural ? kThemeButtonOff : kThemeButtonOn,
sortDirection == eTreeSortDirection_Descending ?
kThemeAdornmentHeaderButtonSortUp : kThemeAdornmentNone, eventState);
kThemeAdornmentHeaderButtonSortUp : kThemeAdornmentNone, eventState, aFrame);
}
break;
@ -1256,7 +1314,7 @@ nsNativeThemeCocoa::DrawWidgetBackground(nsIRenderingContext* aContext, nsIFrame
NS_LITERAL_STRING("reverse"), eCaseMatters);
DrawScale(cgContext, macRect, IsDisabled(aFrame), eventState,
(aWidgetType == NS_THEME_SCALE_VERTICAL), reverse,
curpos, minpos, maxpos);
curpos, minpos, maxpos, aFrame);
}
break;
@ -1337,20 +1395,20 @@ nsNativeThemeCocoa::DrawWidgetBackground(nsIRenderingContext* aContext, nsIFrame
// HIThemeSetFill is not available on 10.3
CGContextSetRGBFillColor(cgContext, 1.0, 1.0, 1.0, 1.0);
CGContextFillRect(cgContext, macRect);
DrawFrame(cgContext, kHIThemeFrameListBox,
macRect, (IsDisabled(aFrame) || IsReadOnly(aFrame)), eventState);
DrawFrame(cgContext, kHIThemeFrameListBox, macRect,
(IsDisabled(aFrame) || IsReadOnly(aFrame)), eventState);
break;
case NS_THEME_TAB: {
DrawTab(cgContext, macRect,
IsDisabled(aFrame), IsSelectedTab(aFrame),
PR_TRUE, IsBottomTab(aFrame),
eventState);
eventState, aFrame);
}
break;
case NS_THEME_TAB_PANELS:
DrawTabPanel(cgContext, macRect);
DrawTabPanel(cgContext, macRect, aFrame);
break;
}