Bug 382147: Make disabled button border-width match enabled buttons. r=roc sr=roc blocking1.9=joshmoz

This commit is contained in:
dholbert@cs.stanford.edu 2007-10-01 09:40:35 -07:00
parent 6613df3bd1
commit e5f2653030
4 changed files with 8 additions and 18 deletions

View File

@ -521,8 +521,8 @@ input[type="submit"][disabled]:active,
input[type="submit"][disabled] {
/* The sum of border-top, border-bottom, padding-top, padding-bottom
must be the same here and for text inputs */
padding: 1px 7px 1px 7px;
border: 1px outset ButtonShadow;
padding: 0px 6px 0px 6px;
border: 2px outset ButtonFace;
color: GrayText;
cursor: inherit;
}

View File

@ -1812,17 +1812,9 @@ nsNativeThemeWin::ClassicGetWidgetBorder(nsIDeviceContext* aContext,
nsMargin* aResult)
{
switch (aWidgetType) {
case NS_THEME_BUTTON: {
const nsStyleUserInterface *uiData = aFrame->GetStyleUserInterface();
if (uiData->mUserFocus == NS_STYLE_USER_FOCUS_IGNORE) {
// use different padding for non-focusable buttons
(*aResult).top = (*aResult).left = 1;
(*aResult).bottom = (*aResult).right = 2;
}
else
(*aResult).top = (*aResult).left = (*aResult).bottom = (*aResult).right = 3;
break;
}
case NS_THEME_BUTTON:
(*aResult).top = (*aResult).left = (*aResult).bottom = (*aResult).right = 2;
break;
case NS_THEME_STATUSBAR:
(*aResult).bottom = (*aResult).left = (*aResult).right = 0;
(*aResult).top = 2;

View File

@ -51,11 +51,10 @@
#include "nsIComponentManager.h"
nsMargin nsNativeTheme::sButtonBorderSize(2, 2, 2, 2);
nsMargin nsNativeTheme::sButtonDisabledBorderSize(1, 1, 1, 1);
PRUint8 nsNativeTheme::sButtonActiveBorderStyle = NS_STYLE_BORDER_STYLE_INSET;
PRUint8 nsNativeTheme::sButtonInactiveBorderStyle = NS_STYLE_BORDER_STYLE_OUTSET;
nsILookAndFeel::nsColorID nsNativeTheme::sButtonBorderColorID = nsILookAndFeel::eColor_buttonface;
nsILookAndFeel::nsColorID nsNativeTheme::sButtonDisabledBorderColorID = nsILookAndFeel::eColor_buttonshadow;
nsILookAndFeel::nsColorID nsNativeTheme::sButtonDisabledBorderColorID = nsILookAndFeel::eColor_buttonface;
nsILookAndFeel::nsColorID nsNativeTheme::sButtonBGColorID = nsILookAndFeel::eColor_buttonface;
nsILookAndFeel::nsColorID nsNativeTheme::sButtonDisabledBGColorID = nsILookAndFeel::eColor_buttonface;
@ -215,8 +214,9 @@ nsNativeTheme::IsWidgetStyled(nsPresContext* aPresContext, nsIFrame* aFrame,
switch (aWidgetType) {
case NS_THEME_BUTTON:
ConvertBorderToAppUnits(aPresContext, sButtonBorderSize,
defaultBorderSize);
if (IsDisabled(aFrame)) {
ConvertBorderToAppUnits(aPresContext, sButtonDisabledBorderSize, defaultBorderSize);
defaultBorderStyle = sButtonInactiveBorderStyle;
lookAndFeel->GetColor(sButtonDisabledBorderColorID,
defaultBorderColor);
@ -224,7 +224,6 @@ nsNativeTheme::IsWidgetStyled(nsPresContext* aPresContext, nsIFrame* aFrame,
defaultBGColor);
} else {
PRInt32 contentState = GetContentState(aFrame, aWidgetType);
ConvertBorderToAppUnits(aPresContext, sButtonBorderSize, defaultBorderSize);
if (contentState & NS_EVENT_STATE_HOVER &&
contentState & NS_EVENT_STATE_ACTIVE)
defaultBorderStyle = sButtonActiveBorderStyle;

View File

@ -140,7 +140,6 @@ class nsNativeTheme
// push buttons
static nsMargin sButtonBorderSize;
static nsMargin sButtonDisabledBorderSize;
static PRUint8 sButtonActiveBorderStyle;
static PRUint8 sButtonInactiveBorderStyle;
static nsILookAndFeel::nsColorID sButtonBorderColorID;