Chromium Code Reviews| Index: ui/views/controls/button/label_button.cc |
| diff --git a/ui/views/controls/button/label_button.cc b/ui/views/controls/button/label_button.cc |
| index 89ae8c351142345a5dce0cca5adea8244b4b3b7f..aaa299b3e19955bcdda9388ccbea078ff9359a36 100644 |
| --- a/ui/views/controls/button/label_button.cc |
| +++ b/ui/views/controls/button/label_button.cc |
| @@ -26,6 +26,12 @@ const int kSpacing = 5; |
| // The length of the hover fade animation. |
| const int kHoverAnimationDurationMs = 170; |
| +// Blue button style default font color. |
| +const SkColor kBlueButtonTextColor = SK_ColorWHITE; |
| + |
| +// Blue button style default font color. |
|
msw
2013/05/16 17:07:36
you mean shadow color...
benwells
2013/05/17 02:24:32
Done.
|
| +const SkColor kBlueButtonShadowColor = SkColorSetRGB(0x53, 0x8C, 0xEA); |
| + |
| } // namespace |
| namespace views { |
| @@ -151,6 +157,9 @@ void LabelButton::SetStyle(ButtonStyle style) { |
| ui::NativeTheme::kColorId_WindowBackground); |
| label_->SetShadowColors(color, color); |
| label_->SetShadowOffset(0, 1); |
| + } else if (style == STYLE_BLUE_BUTTON) { |
| + label_->SetShadowColors(kBlueButtonShadowColor, kBlueButtonShadowColor); |
| + label_->SetShadowOffset(1, 1); |
|
msw
2013/05/16 17:07:36
This should be (0, 1) like above to drop the shado
benwells
2013/05/17 02:24:32
Done.
|
| } |
| // Invalidate the layout to pickup the new insets from the border. |
| InvalidateLayout(); |
| @@ -213,6 +222,12 @@ void LabelButton::ResetColorsFromNativeTheme() { |
| constant_text_color |= (style() == STYLE_NATIVE_TEXTBUTTON && |
| theme == ui::NativeThemeWin::instance()); |
| #endif |
| + if (style() == STYLE_BLUE_BUTTON) { |
| + colors[STATE_NORMAL] = kBlueButtonTextColor; |
| + colors[STATE_DISABLED] = kBlueButtonTextColor; |
| + constant_text_color = true; |
| + } |
| + |
| if (constant_text_color) |
| colors[STATE_HOVERED] = colors[STATE_PRESSED] = colors[STATE_NORMAL]; |
| @@ -227,7 +242,7 @@ void LabelButton::ResetColorsFromNativeTheme() { |
| void LabelButton::StateChanged() { |
| const gfx::Size previous_image_size(image_->GetPreferredSize()); |
| image_->SetImage(GetImage(state())); |
| - const SkColor color = button_state_colors_[state()]; |
| + SkColor color = button_state_colors_[state()]; |
| if (state() != STATE_DISABLED && label_->enabled_color() != color) |
| label_->SetEnabledColor(color); |
| label_->SetEnabled(state() != STATE_DISABLED); |