Commit 8d29e7cc authored by estade@chromium.org's avatar estade@chromium.org

Don't put a text shadow on blue buttons in gtk theme mode.

BUG=381541

Review URL: https://codereview.chromium.org/360123003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@282271 0039d316-1c4b-4281-b951-d872f2087c98
parent a109fd05
......@@ -151,6 +151,9 @@ void NativeThemeGtk2::Paint(SkCanvas* canvas,
}
SkColor NativeThemeGtk2::GetSystemColor(ColorId color_id) const {
if (color_id == kColorId_BlueButtonShadowColor)
return SK_ColorTRANSPARENT;
return GdkColorToSkColor(GetSystemGdkColor(color_id));
}
......@@ -270,6 +273,10 @@ GdkColor NativeThemeGtk2::GetSystemGdkColor(ColorId color_id) const {
return GetButtonStyle()->bg[GTK_STATE_PRELIGHT];
case kColorId_BlueButtonPressedColor:
return GetButtonStyle()->text[GTK_STATE_ACTIVE];
case kColorId_BlueButtonShadowColor:
// Should be handled in GetSystemColor().
NOTREACHED();
return GetButtonStyle()->text[GTK_STATE_NORMAL];
// Textfield
case kColorId_TextfieldDefaultColor:
......
......@@ -39,6 +39,7 @@ const SkColor kBlueButtonEnabledColor = SK_ColorWHITE;
const SkColor kBlueButtonDisabledColor = SK_ColorWHITE;
const SkColor kBlueButtonPressedColor = SK_ColorWHITE;
const SkColor kBlueButtonHoverColor = SK_ColorWHITE;
const SkColor kBlueButtonShadowColor = SkColorSetRGB(0x53, 0x8C, 0xEA);
} // namespace
......@@ -101,6 +102,8 @@ bool CommonThemeGetSystemColor(NativeTheme::ColorId color_id, SkColor* color) {
break;
case NativeTheme::kColorId_BlueButtonHoverColor:
*color = kBlueButtonHoverColor;
case NativeTheme::kColorId_BlueButtonShadowColor:
*color = kBlueButtonShadowColor;
break;
default:
return false;
......
......@@ -258,6 +258,7 @@ class NATIVE_THEME_EXPORT NativeTheme {
kColorId_BlueButtonDisabledColor,
kColorId_BlueButtonPressedColor,
kColorId_BlueButtonHoverColor,
kColorId_BlueButtonShadowColor,
// MenuItem
kColorId_EnabledMenuItemForegroundColor,
kColorId_DisabledMenuItemForegroundColor,
......
......@@ -9,13 +9,6 @@
#include "ui/gfx/sys_color_change_listener.h"
#include "ui/views/controls/button/label_button_border.h"
namespace {
// Default shadow color for the blue button.
const SkColor kBlueButtonShadowColor = SkColorSetRGB(0x53, 0x8C, 0xEA);
} // namespace
namespace views {
// static
......@@ -42,9 +35,13 @@ void BlueButton::ResetColorsFromNativeTheme() {
SetTextColor(STATE_DISABLED, GetNativeTheme()->
GetSystemColor(ui::NativeTheme::kColorId_BlueButtonDisabledColor));
// TODO(estade): this is not great on system themes.
label()->set_shadows(gfx::ShadowValues(1,
gfx::ShadowValue(gfx::Point(0, 1), 0, kBlueButtonShadowColor)));
label()->set_shadows(gfx::ShadowValues(
1,
gfx::ShadowValue(
gfx::Point(0, 1),
0,
GetNativeTheme()->GetSystemColor(
ui::NativeTheme::kColorId_BlueButtonShadowColor))));
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment