From d4874ee0d04100176470fa5cba99cf43cf5a13b7 Mon Sep 17 00:00:00 2001 From: "mkaply%us.ibm.com" Date: Wed, 18 Jun 2003 21:16:29 +0000 Subject: [PATCH] #188071 r=mkaply, sr=dbaron Add a lookandfeel color for button default so it can be different than 3D shadow --- widget/src/beos/nsLookAndFeel.cpp | 5 ++++- widget/src/gtk/nsLookAndFeel.cpp | 4 ++++ widget/src/gtk2/nsLookAndFeel.cpp | 4 ++++ widget/src/mac/nsLookAndFeel.cpp | 3 +++ widget/src/os2/nsLookAndFeel.cpp | 5 ++++- widget/src/photon/nsLookAndFeel.cpp | 4 ++++ widget/src/windows/nsLookAndFeel.cpp | 11 +++++++---- widget/src/xlib/nsLookAndFeel.cpp | 5 +++++ widget/src/xpwidgets/nsXPLookAndFeel.cpp | 1 + 9 files changed, 36 insertions(+), 6 deletions(-) diff --git a/widget/src/beos/nsLookAndFeel.cpp b/widget/src/beos/nsLookAndFeel.cpp index bc5b4638586..632ab162478 100644 --- a/widget/src/beos/nsLookAndFeel.cpp +++ b/widget/src/beos/nsLookAndFeel.cpp @@ -243,7 +243,10 @@ nsresult nsLookAndFeel::NativeGetColor(const nsColorID aID, nscolor &aColor) break; case eColor__moz_dragtargetzone: aColor = NS_RGB(0x63, 0x63, 0xCE); - break; + break; + case eColor__moz_buttondefault: + aColor = NS_RGB(0x77, 0x77, 0x77); + break; case eColor_LAST_COLOR: default: aColor = NS_RGB(0xff, 0xff, 0xff); diff --git a/widget/src/gtk/nsLookAndFeel.cpp b/widget/src/gtk/nsLookAndFeel.cpp index 4aeb6b875f1..478cc9fa1fc 100644 --- a/widget/src/gtk/nsLookAndFeel.cpp +++ b/widget/src/gtk/nsLookAndFeel.cpp @@ -247,6 +247,10 @@ nsresult nsLookAndFeel::NativeGetColor(const nsColorID aID, nscolor& aColor) case eColor__moz_dragtargetzone: aColor = GDK_COLOR_TO_NS_RGB(mStyle->bg[GTK_STATE_SELECTED]); break; + case eColor__moz_buttondefault: + // default button border color + aColor = GDK_COLOR_TO_NS_RGB(mStyle->black); + break; default: /* default color is BLACK */ aColor = 0; diff --git a/widget/src/gtk2/nsLookAndFeel.cpp b/widget/src/gtk2/nsLookAndFeel.cpp index 4b43f08fe09..fd53ef1101c 100644 --- a/widget/src/gtk2/nsLookAndFeel.cpp +++ b/widget/src/gtk2/nsLookAndFeel.cpp @@ -251,6 +251,10 @@ nsresult nsLookAndFeel::NativeGetColor(const nsColorID aID, nscolor& aColor) case eColor__moz_dragtargetzone: aColor = GDK_COLOR_TO_NS_RGB(mStyle->bg[GTK_STATE_SELECTED]); break; + case eColor__moz_buttondefault: + // default button border color + aColor = GDK_COLOR_TO_NS_RGB(mStyle->black); + break; default: /* default color is BLACK */ aColor = 0; diff --git a/widget/src/mac/nsLookAndFeel.cpp b/widget/src/mac/nsLookAndFeel.cpp index efa964c83e1..42615cbe001 100644 --- a/widget/src/mac/nsLookAndFeel.cpp +++ b/widget/src/mac/nsLookAndFeel.cpp @@ -324,6 +324,9 @@ nsresult nsLookAndFeel::NativeGetColor(const nsColorID aID, nscolor &aColor) //get this colour by querying variation table, ows. default to Platinum/Lavendar res = GetMacAccentColor(eColorOffset_mac_accentdarkestshadow, aColor, NS_RGB(0x00,0x00,0x55)); break; + case eColor__moz_buttondefault: + res = GetMacBrushColor(kThemeBrushButtonActiveDarkShadow, aColor, NS_RGB(0x77,0x77,0x77)); + break; default: NS_WARNING("Someone asked nsILookAndFeel for a color I don't know about"); aColor = NS_RGB(0xff,0xff,0xff); diff --git a/widget/src/os2/nsLookAndFeel.cpp b/widget/src/os2/nsLookAndFeel.cpp index b1eeeb135ff..2f204e9f830 100644 --- a/widget/src/os2/nsLookAndFeel.cpp +++ b/widget/src/os2/nsLookAndFeel.cpp @@ -157,7 +157,7 @@ nsresult nsLookAndFeel::NativeGetColor(const nsColorID aID, nscolor &aColor) idx = SYSCLR_SCROLLBAR; break; case eColor_threeddarkshadow: - idx = SYSCLR_BUTTONDEFAULT; + idx = SYSCLR_BUTTONDARK; break; case eColor_threedface: idx = SYSCLR_BUTTONMIDDLE; @@ -192,6 +192,9 @@ nsresult nsLookAndFeel::NativeGetColor(const nsColorID aID, nscolor &aColor) case eColor__moz_dialogtext: idx = SYSCLR_WINDOWTEXT; break; + case eColor__moz_buttondefault: + idx = SYSCLR_BUTTONDEFAULT; + break; default: idx = SYSCLR_WINDOW; break; diff --git a/widget/src/photon/nsLookAndFeel.cpp b/widget/src/photon/nsLookAndFeel.cpp index 56d1604c1d4..7c69a74a2ee 100644 --- a/widget/src/photon/nsLookAndFeel.cpp +++ b/widget/src/photon/nsLookAndFeel.cpp @@ -212,6 +212,10 @@ nsresult nsLookAndFeel::NativeGetColor(const nsColorID aID, nscolor &aColor) aColor = PH_TO_NS_RGB(Pg_LGREY); break; + case eColor__moz_buttondefault: + aColor = PH_TO_NS_RGB(Pg_DGREY); + break; + default: aColor = PH_TO_NS_RGB(Pg_WHITE); break; diff --git a/widget/src/windows/nsLookAndFeel.cpp b/widget/src/windows/nsLookAndFeel.cpp index 358d656e817..a1e35538151 100644 --- a/widget/src/windows/nsLookAndFeel.cpp +++ b/widget/src/windows/nsLookAndFeel.cpp @@ -190,11 +190,14 @@ nsresult nsLookAndFeel::NativeGetColor(const nsColorID aID, nscolor &aColor) idx = COLOR_WINDOWTEXT; break; case eColor__moz_dragtargetzone: - idx = COLOR_HIGHLIGHTTEXT; - break; + idx = COLOR_HIGHLIGHTTEXT; + break; + case eColor__moz_buttondefault: + idx = COLOR_3DDKSHADOW; + break; default: - idx = COLOR_WINDOW; - break; + idx = COLOR_WINDOW; + break; } DWORD color = ::GetSysColor(idx); diff --git a/widget/src/xlib/nsLookAndFeel.cpp b/widget/src/xlib/nsLookAndFeel.cpp index a1f0440ab08..4ca5c9426f6 100644 --- a/widget/src/xlib/nsLookAndFeel.cpp +++ b/widget/src/xlib/nsLookAndFeel.cpp @@ -197,6 +197,11 @@ nsresult nsLookAndFeel::NativeGetColor(const nsColorID aID, nscolor &aColor) aColor = NS_RGB(0x00, 0x00, 0x00); break; + case eColor__moz_buttondefault: + // default button border color + aColor = NS_RGB(0x00, 0x00, 0x00); + break; + default: /* default color is BLACK */ aColor = 0; diff --git a/widget/src/xpwidgets/nsXPLookAndFeel.cpp b/widget/src/xpwidgets/nsXPLookAndFeel.cpp index bc1ca8d8ce4..67fb370f31d 100644 --- a/widget/src/xpwidgets/nsXPLookAndFeel.cpp +++ b/widget/src/xpwidgets/nsXPLookAndFeel.cpp @@ -170,6 +170,7 @@ char* nsXPLookAndFeel::sColorPrefs[] = "ui.window", "ui.windowframe", "ui.windowtext", + "ui.-moz-buttondefault", "ui.-moz-field", "ui.-moz-fieldtext", "ui.-moz-dialog",