Bug 396984 - Fix GTK textfield border-width 2px/3px discrepancy. Patch by Michael Ventnor <ventnor.bugzilla@yahoo.com.au>, r/sr/a=roc

This commit is contained in:
dholbert@cs.stanford.edu 2007-10-02 14:25:59 -07:00
parent d5f33192a5
commit c5dacf1625
2 changed files with 34 additions and 7 deletions

View File

@ -80,7 +80,11 @@ input {
must be the same here, for buttons, and for <select> (including its must be the same here, for buttons, and for <select> (including its
internal padding magic) */ internal padding magic) */
padding: 1px 0 1px 0; padding: 1px 0 1px 0;
%ifdef MOZ_WIDGET_GTK2
border: 3px inset ThreeDFace;
%else
border: 2px inset ThreeDFace; border: 2px inset ThreeDFace;
%endif
background-color: -moz-Field; background-color: -moz-Field;
color: -moz-FieldText; color: -moz-FieldText;
font: -moz-field; font: -moz-field;
@ -102,7 +106,11 @@ input > .anonymous-div {
textarea { textarea {
margin: 1px 0 1px 0; margin: 1px 0 1px 0;
%ifdef MOZ_WIDGET_GTK2
border: 3px inset ThreeDFace;
%else
border: 2px inset ThreeDFace; border: 2px inset ThreeDFace;
%endif
background-color: -moz-Field; background-color: -moz-Field;
color: -moz-FieldText; color: -moz-FieldText;
font: medium -moz-fixed; font: medium -moz-fixed;
@ -143,7 +151,11 @@ textarea:-moz-read-write {
select { select {
margin: 0; margin: 0;
border-color: ThreeDFace; %ifdef MOZ_WIDGET_GTK2
border: 3px inset ThreeDFace;
%else
border: 2px inset ThreeDFace;
%endif
background-color: -moz-Field; background-color: -moz-Field;
color: -moz-FieldText; color: -moz-FieldText;
font: -moz-list; font: -moz-list;
@ -154,8 +166,6 @@ select {
-moz-box-sizing: border-box; -moz-box-sizing: border-box;
-moz-user-select: none; -moz-user-select: none;
-moz-appearance: menulist; -moz-appearance: menulist;
border-width: 2px;
border-style: inset;
text-indent: 0; text-indent: 0;
overflow: -moz-hidden-unscrollable; overflow: -moz-hidden-unscrollable;
} }
@ -462,7 +472,11 @@ input[type="submit"] {
must be the same here, for text inputs, and for <select>. For must be the same here, for text inputs, and for <select>. For
buttons, make sure to include the -moz-focus-inner border/padding. */ buttons, make sure to include the -moz-focus-inner border/padding. */
padding: 0px 6px 0px 6px; padding: 0px 6px 0px 6px;
%ifdef MOZ_WIDGET_GTK2
border: 3px outset ButtonFace;
%else
border: 2px outset ButtonFace; border: 2px outset ButtonFace;
%endif
background-color: ButtonFace; background-color: ButtonFace;
color: ButtonText; color: ButtonText;
font: -moz-button; font: -moz-button;
@ -522,7 +536,11 @@ input[type="submit"][disabled] {
/* The sum of border-top, border-bottom, padding-top, padding-bottom /* The sum of border-top, border-bottom, padding-top, padding-bottom
must be the same here and for text inputs */ must be the same here and for text inputs */
padding: 0px 6px 0px 6px; padding: 0px 6px 0px 6px;
%ifdef MOZ_WIDGET_GTK2
border: 3px outset ButtonFace;
%else
border: 2px outset ButtonFace; border: 2px outset ButtonFace;
%endif
color: GrayText; color: GrayText;
cursor: inherit; cursor: inherit;
} }

View File

@ -50,7 +50,6 @@
#include "nsThemeConstants.h" #include "nsThemeConstants.h"
#include "nsIComponentManager.h" #include "nsIComponentManager.h"
nsMargin nsNativeTheme::sButtonBorderSize(2, 2, 2, 2);
PRUint8 nsNativeTheme::sButtonActiveBorderStyle = NS_STYLE_BORDER_STYLE_INSET; PRUint8 nsNativeTheme::sButtonActiveBorderStyle = NS_STYLE_BORDER_STYLE_INSET;
PRUint8 nsNativeTheme::sButtonInactiveBorderStyle = NS_STYLE_BORDER_STYLE_OUTSET; PRUint8 nsNativeTheme::sButtonInactiveBorderStyle = NS_STYLE_BORDER_STYLE_OUTSET;
nsILookAndFeel::nsColorID nsNativeTheme::sButtonBorderColorID = nsILookAndFeel::eColor_buttonface; nsILookAndFeel::nsColorID nsNativeTheme::sButtonBorderColorID = nsILookAndFeel::eColor_buttonface;
@ -58,26 +57,36 @@ nsILookAndFeel::nsColorID nsNativeTheme::sButtonDisabledBorderColorID = nsILookA
nsILookAndFeel::nsColorID nsNativeTheme::sButtonBGColorID = nsILookAndFeel::eColor_buttonface; nsILookAndFeel::nsColorID nsNativeTheme::sButtonBGColorID = nsILookAndFeel::eColor_buttonface;
nsILookAndFeel::nsColorID nsNativeTheme::sButtonDisabledBGColorID = nsILookAndFeel::eColor_buttonface; nsILookAndFeel::nsColorID nsNativeTheme::sButtonDisabledBGColorID = nsILookAndFeel::eColor_buttonface;
nsMargin nsNativeTheme::sTextfieldBorderSize(2, 2, 2, 2);
PRUint8 nsNativeTheme::sTextfieldBorderStyle = NS_STYLE_BORDER_STYLE_INSET; PRUint8 nsNativeTheme::sTextfieldBorderStyle = NS_STYLE_BORDER_STYLE_INSET;
nsILookAndFeel::nsColorID nsNativeTheme::sTextfieldBorderColorID = nsILookAndFeel::eColor_threedface; nsILookAndFeel::nsColorID nsNativeTheme::sTextfieldBorderColorID = nsILookAndFeel::eColor_threedface;
PRBool nsNativeTheme::sTextfieldBGTransparent = PR_FALSE; PRBool nsNativeTheme::sTextfieldBGTransparent = PR_FALSE;
nsILookAndFeel::nsColorID nsNativeTheme::sTextfieldBGColorID = nsILookAndFeel::eColor__moz_field; nsILookAndFeel::nsColorID nsNativeTheme::sTextfieldBGColorID = nsILookAndFeel::eColor__moz_field;
nsILookAndFeel::nsColorID nsNativeTheme::sTextfieldDisabledBGColorID = nsILookAndFeel::eColor_threedface; nsILookAndFeel::nsColorID nsNativeTheme::sTextfieldDisabledBGColorID = nsILookAndFeel::eColor_threedface;
nsMargin nsNativeTheme::sListboxBorderSize(2, 2, 2, 2);
PRUint8 nsNativeTheme::sListboxBorderStyle = NS_STYLE_BORDER_STYLE_INSET; PRUint8 nsNativeTheme::sListboxBorderStyle = NS_STYLE_BORDER_STYLE_INSET;
nsILookAndFeel::nsColorID nsNativeTheme::sListboxBorderColorID = nsILookAndFeel::eColor_threedface; nsILookAndFeel::nsColorID nsNativeTheme::sListboxBorderColorID = nsILookAndFeel::eColor_threedface;
nsILookAndFeel::nsColorID nsNativeTheme::sListboxBGColorID = nsILookAndFeel::eColor__moz_field; nsILookAndFeel::nsColorID nsNativeTheme::sListboxBGColorID = nsILookAndFeel::eColor__moz_field;
nsILookAndFeel::nsColorID nsNativeTheme::sListboxDisabledBGColorID = nsILookAndFeel::eColor_threedface; nsILookAndFeel::nsColorID nsNativeTheme::sListboxDisabledBGColorID = nsILookAndFeel::eColor_threedface;
nsMargin nsNativeTheme::sComboboxBorderSize(2, 2, 2, 2);
PRUint8 nsNativeTheme::sComboboxBorderStyle = NS_STYLE_BORDER_STYLE_INSET; PRUint8 nsNativeTheme::sComboboxBorderStyle = NS_STYLE_BORDER_STYLE_INSET;
nsILookAndFeel::nsColorID nsNativeTheme::sComboboxBorderColorID = nsILookAndFeel::eColor_threedface; nsILookAndFeel::nsColorID nsNativeTheme::sComboboxBorderColorID = nsILookAndFeel::eColor_threedface;
PRBool nsNativeTheme::sComboboxBGTransparent = PR_FALSE; PRBool nsNativeTheme::sComboboxBGTransparent = PR_FALSE;
nsILookAndFeel::nsColorID nsNativeTheme::sComboboxBGColorID = nsILookAndFeel::eColor__moz_field; nsILookAndFeel::nsColorID nsNativeTheme::sComboboxBGColorID = nsILookAndFeel::eColor__moz_field;
nsILookAndFeel::nsColorID nsNativeTheme::sComboboxDisabledBGColorID = nsILookAndFeel::eColor_threedface; nsILookAndFeel::nsColorID nsNativeTheme::sComboboxDisabledBGColorID = nsILookAndFeel::eColor_threedface;
#ifdef MOZ_WIDGET_GTK2
// Cross-platform assumptions are evil. GTK seems to give 3px border on every widget.
nsMargin nsNativeTheme::sTextfieldBorderSize(3, 3, 3, 3);
nsMargin nsNativeTheme::sListboxBorderSize(3, 3, 3, 3);
nsMargin nsNativeTheme::sComboboxBorderSize(3, 3, 3, 3);
nsMargin nsNativeTheme::sButtonBorderSize(3, 3, 3, 3);
#else
nsMargin nsNativeTheme::sTextfieldBorderSize(2, 2, 2, 2);
nsMargin nsNativeTheme::sListboxBorderSize(2, 2, 2, 2);
nsMargin nsNativeTheme::sComboboxBorderSize(2, 2, 2, 2);
nsMargin nsNativeTheme::sButtonBorderSize(2, 2, 2, 2);
#endif
nsNativeTheme::nsNativeTheme() nsNativeTheme::nsNativeTheme()
{ {
} }