remove support for NS_THEME_BUTTON_SMALL, fix up toolkit consumer. b=379542 r=cbarrett r=mano sr=roc
authorjoshmoz@gmail.com
Mon, 07 May 2007 18:20:11 -0700
changeset 1268 1caa7637c4510bcc69b63c9882aab1837f5647e4
parent 1267 f221271a7211839da8c93a2b396b1680a188f82e
child 1269 006125ab92f96288e092482bfb11b05904a64038
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewerscbarrett, mano, roc
bugs379542
milestone1.9a5pre
remove support for NS_THEME_BUTTON_SMALL, fix up toolkit consumer. b=379542 r=cbarrett r=mano sr=roc
gfx/public/nsThemeConstants.h
layout/style/nsCSSKeywordList.h
layout/style/nsCSSProps.cpp
toolkit/themes/pinstripe/global/customizeToolbar.css
widget/src/cocoa/nsNativeThemeCocoa.mm
--- a/gfx/public/nsThemeConstants.h
+++ b/gfx/public/nsThemeConstants.h
@@ -11,19 +11,16 @@
 #define NS_THEME_CHECKBOX                                  3
 
 // A small radio button, for HTML forms
 #define NS_THEME_RADIO_SMALL                               4
 
 // A small checkbox, for HTML forms
 #define NS_THEME_CHECKBOX_SMALL                            5
 
-// A small button, for HTML forms
-#define NS_THEME_BUTTON_SMALL                              6
-
 // A rectangular button that contains complex content
 // like images (e.g. HTML <button> elements)
 #define NS_THEME_BUTTON_BEVEL                              7
 
 // The toolbox that contains the toolbars.
 #define NS_THEME_TOOLBOX                                   11
 
 // A toolbar in an application window.
--- a/layout/style/nsCSSKeywordList.h
+++ b/layout/style/nsCSSKeywordList.h
@@ -463,17 +463,16 @@ CSS_KEY(x-soft, x_soft)
 CSS_KEY(xx-large, xx_large)
 CSS_KEY(xx-small, xx_small)
 
 // Appearance keywords for widget styles
 CSS_KEY(radio, radio)
 CSS_KEY(checkbox, checkbox)
 CSS_KEY(radio-small, radio_small)
 CSS_KEY(checkbox-small, checkbox_small)
-CSS_KEY(button-small, button_small)
 CSS_KEY(button-bevel, button_bevel)
 CSS_KEY(toolbox, toolbox)
 CSS_KEY(toolbar, toolbar)
 CSS_KEY(toolbarbutton, toolbarbutton)
 CSS_KEY(toolbargripper, toolbargripper)
 CSS_KEY(dualbutton, dualbutton)
 CSS_KEY(dualbutton-dropdown, dualbutton_dropdown)
 CSS_KEY(separator, separator)
--- a/layout/style/nsCSSProps.cpp
+++ b/layout/style/nsCSSProps.cpp
@@ -177,17 +177,16 @@ nsCSSProps::GetStringValue(nsCSSProperty
 
 const PRInt32 nsCSSProps::kAppearanceKTable[] = {
   eCSSKeyword_none,                   NS_THEME_NONE,
   eCSSKeyword_button,                 NS_THEME_BUTTON,
   eCSSKeyword_radio,                  NS_THEME_RADIO,
   eCSSKeyword_checkbox,               NS_THEME_CHECKBOX,
   eCSSKeyword_radio_small,            NS_THEME_RADIO_SMALL,
   eCSSKeyword_checkbox_small,         NS_THEME_CHECKBOX_SMALL,
-  eCSSKeyword_button_small,           NS_THEME_BUTTON_SMALL,
   eCSSKeyword_button_bevel,           NS_THEME_BUTTON_BEVEL,
   eCSSKeyword_toolbox,                NS_THEME_TOOLBOX,
   eCSSKeyword_toolbar,                NS_THEME_TOOLBAR,
   eCSSKeyword_toolbarbutton,          NS_THEME_TOOLBAR_BUTTON,
   eCSSKeyword_toolbargripper,         NS_THEME_TOOLBAR_GRIPPER,
   eCSSKeyword_dualbutton,             NS_THEME_TOOLBAR_DUAL_BUTTON,
   eCSSKeyword_dualbutton_dropdown,    NS_THEME_TOOLBAR_DUAL_BUTTON_DROPDOWN,
   eCSSKeyword_separator,              NS_THEME_TOOLBAR_SEPARATOR,
--- a/toolkit/themes/pinstripe/global/customizeToolbar.css
+++ b/toolkit/themes/pinstripe/global/customizeToolbar.css
@@ -61,11 +61,11 @@
 	line-height: 16pt;
 }
 
 hbox button {
 	font: menu;
 }
 
 #main-box > box > button {
-	-moz-appearance: button-small;
+	min-height: 19px; /* aqua size for small buttons */
 	font: message-box;
-}
\ No newline at end of file
+}
--- a/widget/src/cocoa/nsNativeThemeCocoa.mm
+++ b/widget/src/cocoa/nsNativeThemeCocoa.mm
@@ -633,21 +633,19 @@ nsNativeThemeCocoa::DrawWidgetBackground
         // XXX this should probably happen earlier, before transform; this is very fragile
         macRect.size.height += 1.0;
       }
       DrawCheckboxRadio(cgContext, kThemeSmallRadioButton, macRect,
                         IsSelected(aFrame), IsDisabled(aFrame), eventState);
       break;
 
     case NS_THEME_BUTTON:
-    case NS_THEME_BUTTON_SMALL: {
       DrawButton(cgContext, kThemePushButton, macRect,
                  IsDefaultButton(aFrame), IsDisabled(aFrame),
                  kThemeButtonOn, kThemeAdornmentNone, eventState);
-    }
       break;
 
     case NS_THEME_BUTTON_BEVEL:
       DrawButton(cgContext, kThemeMediumBevelButton, macRect,
                  IsDefaultButton(aFrame), IsDisabled(aFrame), 
                  kThemeButtonOff, kThemeAdornmentNone, eventState);
       break;
 
@@ -870,17 +868,16 @@ nsNativeThemeCocoa::GetWidgetBorder(nsID
                                     nsIFrame* aFrame,
                                     PRUint8 aWidgetType,
                                     nsMargin* aResult)
 {
   aResult->SizeTo(0, 0, 0, 0);
 
   switch (aWidgetType) {
     case NS_THEME_BUTTON:
-    case NS_THEME_BUTTON_SMALL:
       // Top has a single pixel line, bottom has a single pixel line plus a single
       // pixel shadow
       aResult->SizeTo(kAquaPushButtonEndcaps, 1, 
                       kAquaPushButtonEndcaps, 2);
       break;
 
     case NS_THEME_DROPDOWN:
     case NS_THEME_DROPDOWN_BUTTON:
@@ -962,17 +959,16 @@ nsNativeThemeCocoa::GetWidgetPadding(nsI
 
 
 PRBool
 nsNativeThemeCocoa::GetWidgetOverflow(nsIDeviceContext* aContext, nsIFrame* aFrame,
                                       PRUint8 aWidgetType, nsRect* aResult)
 {
   switch (aWidgetType) {
     case NS_THEME_BUTTON:
-    case NS_THEME_BUTTON_SMALL:
     case NS_THEME_TEXTFIELD:
     case NS_THEME_TEXTFIELD_MULTILINE:
     case NS_THEME_LISTBOX:
     case NS_THEME_DROPDOWN:
     case NS_THEME_DROPDOWN_BUTTON:
     case NS_THEME_CHECKBOX:
     case NS_THEME_CHECKBOX_SMALL:
     case NS_THEME_RADIO:
@@ -1004,17 +1000,16 @@ nsNativeThemeCocoa::GetMinimumWidgetSize
                                          nsSize* aResult,
                                          PRBool* aIsOverridable)
 {
   aResult->SizeTo(0,0);
   *aIsOverridable = PR_TRUE;
 
   switch (aWidgetType) {
     case NS_THEME_BUTTON:
-    case NS_THEME_BUTTON_SMALL:
     {
       aResult->SizeTo(MIN_SCALED_BUTTON_WIDTH, MIN_SCALED_BUTTON_HEIGHT);
       break;
     }
 
     case NS_THEME_SPINNER:
     {
       SInt32 buttonHeight = 0;
@@ -1316,17 +1311,16 @@ nsNativeThemeCocoa::ThemeSupportsWidget(
     
     case NS_THEME_CHECKBOX:
     case NS_THEME_CHECKBOX_SMALL:
     case NS_THEME_CHECKBOX_CONTAINER:
     case NS_THEME_RADIO:
     case NS_THEME_RADIO_SMALL:
     case NS_THEME_RADIO_CONTAINER:
     case NS_THEME_BUTTON:
-    case NS_THEME_BUTTON_SMALL:
     case NS_THEME_BUTTON_BEVEL:
     case NS_THEME_SPINNER:
     case NS_THEME_TOOLBAR:
     case NS_THEME_STATUSBAR:
     case NS_THEME_TEXTFIELD:
     case NS_THEME_TEXTFIELD_MULTILINE:
     //case NS_THEME_TOOLBOX:
     //case NS_THEME_TOOLBAR_BUTTON:
@@ -1396,14 +1390,13 @@ nsNativeThemeCocoa::WidgetIsContainer(PR
   return PR_TRUE;
 }
 
 
 PRBool
 nsNativeThemeCocoa::ThemeDrawsFocusForWidget(nsPresContext* aPresContext, nsIFrame* aFrame, PRUint8 aWidgetType)
 {
   if (aWidgetType == NS_THEME_DROPDOWN ||
-      aWidgetType == NS_THEME_BUTTON ||
-      aWidgetType == NS_THEME_BUTTON_SMALL)
+      aWidgetType == NS_THEME_BUTTON)
     return PR_TRUE;
   
   return PR_FALSE;
 }