зеркало из https://github.com/mozilla/gecko-dev.git
Bug 301688 - [Mac] Disabled buttons shoud never have a 'default button' look&feel. r=josh, sr=smfr, a=bsmedberg.
This commit is contained in:
Родитель
92ea40f18d
Коммит
4e6e20418c
|
@ -163,13 +163,15 @@ nsNativeThemeMac::DrawButton ( ThemeButtonKind inKind, const Rect& inBoxRect, PR
|
||||||
PRInt32 inState )
|
PRInt32 inState )
|
||||||
{
|
{
|
||||||
ThemeButtonDrawInfo info;
|
ThemeButtonDrawInfo info;
|
||||||
if ( inDisabled )
|
|
||||||
info.state = kThemeStateUnavailableInactive;
|
|
||||||
else
|
|
||||||
info.state = ((inState & NS_EVENT_STATE_ACTIVE) && (inState & NS_EVENT_STATE_HOVER)) ?
|
|
||||||
kThemeStatePressed : kThemeStateActive;
|
|
||||||
info.value = inValue;
|
info.value = inValue;
|
||||||
info.adornment = inAdornment;
|
info.adornment = inAdornment;
|
||||||
|
|
||||||
|
if ( inDisabled )
|
||||||
|
info.state = kThemeStateUnavailableInactive;
|
||||||
|
else {
|
||||||
|
info.state = ((inState & NS_EVENT_STATE_ACTIVE) && (inState & NS_EVENT_STATE_HOVER)) ?
|
||||||
|
kThemeStatePressed : kThemeStateActive;
|
||||||
if ( inState & NS_EVENT_STATE_FOCUS ) {
|
if ( inState & NS_EVENT_STATE_FOCUS ) {
|
||||||
// There is a bug in OS 10.2.x-10.3.x where if we are in a CG context and
|
// There is a bug in OS 10.2.x-10.3.x where if we are in a CG context and
|
||||||
// draw the focus ring with DrawThemeButton(), there are ugly lines all
|
// draw the focus ring with DrawThemeButton(), there are ugly lines all
|
||||||
|
@ -180,7 +182,7 @@ nsNativeThemeMac::DrawButton ( ThemeButtonKind inKind, const Rect& inBoxRect, PR
|
||||||
}
|
}
|
||||||
if ( inIsDefault )
|
if ( inIsDefault )
|
||||||
info.adornment |= kThemeAdornmentDefault;
|
info.adornment |= kThemeAdornmentDefault;
|
||||||
|
}
|
||||||
::DrawThemeButton ( &inBoxRect, inKind, &info, nsnull, mEraseProc, nsnull, 0L );
|
::DrawThemeButton ( &inBoxRect, inKind, &info, nsnull, mEraseProc, nsnull, 0L );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче