Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(180)

Unified Diff: ui/views/controls/button/label_button.cc

Issue 288983010: fix text color of BlueButton on GTK-theme-mode Linux Aura. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: set bg color based on state Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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()];
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698