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 fd9d5641d5e38fca453140e5d9bbd386092723fb..00d00edef44501873354c13693a7bcb59aef84a0 100644 |
| --- a/ui/views/controls/button/label_button.cc |
| +++ b/ui/views/controls/button/label_button.cc |
| @@ -365,7 +365,10 @@ void LabelButton::UpdateThemedBorder() { |
| #if defined(OS_LINUX) && !defined(OS_CHROMEOS) |
| views::LinuxUI* linux_ui = views::LinuxUI::instance(); |
| if (linux_ui) { |
| + Border* default_border = label_button_border.get(); |
| SetBorder(linux_ui->CreateNativeBorder(this, label_button_border.Pass())); |
| + // If we're using a system-themed border, make sure the text is legible. |
| + label_->SetAutoColorReadabilityEnabled(border() != default_border); |
|
msw
2014/05/29 19:52:23
Should the label background color be initialized h
|
| } else |
| #endif |
| { |
| @@ -376,6 +379,13 @@ void LabelButton::UpdateThemedBorder() { |
| } |
| void LabelButton::StateChanged() { |
| + if (border_is_themed_border_) { |
| + label_->SetBackgroundColor(GetNativeTheme()->GetSystemColor( |
|
msw
2014/05/29 02:03:55
Does this work right if gfx::IsInvertedColorScheme
Evan Stade
2014/05/29 19:04:45
Do I need a Windows machine to test that? Is the b
msw
2014/05/29 19:52:23
Yeah, IsInvertedColorScheme is only supported on W
|
| + state() == STATE_HOVERED ? |
| + ui::NativeTheme::kColorId_ButtonHoverBackgroundColor : |
| + ui::NativeTheme::kColorId_ButtonBackgroundColor)); |
| + } |
| + |
| const gfx::Size previous_image_size(image_->GetPreferredSize()); |
| UpdateImage(); |
| const SkColor color = button_state_colors_[state()]; |