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

Side by Side Diff: ui/views/controls/button/blue_button.cc

Issue 23534062: Fix Views blue button's blurry text on Aura. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Make LabelButton::ResetColorsFromNativeTheme virtual; override for BlueButton. Created 7 years, 3 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/views/controls/button/blue_button.h ('k') | ui/views/controls/button/label_button.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/views/controls/button/blue_button.h" 5 #include "ui/views/controls/button/blue_button.h"
6 6
7 #include "grit/ui_resources.h" 7 #include "grit/ui_resources.h"
8 #include "ui/base/accessibility/accessible_view_state.h" 8 #include "ui/base/accessibility/accessible_view_state.h"
9 #include "ui/base/resource/resource_bundle.h" 9 #include "ui/base/resource/resource_bundle.h"
10 #include "ui/gfx/sys_color_change_listener.h" 10 #include "ui/gfx/sys_color_change_listener.h"
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 *rb.GetImageSkiaNamed(IDR_BLUE_BUTTON_FOCUSED_NORMAL), insets)); 56 *rb.GetImageSkiaNamed(IDR_BLUE_BUTTON_FOCUSED_NORMAL), insets));
57 button_border->SetPainter(true, STATE_HOVERED, 57 button_border->SetPainter(true, STATE_HOVERED,
58 Painter::CreateImagePainter( 58 Painter::CreateImagePainter(
59 *rb.GetImageSkiaNamed(IDR_BLUE_BUTTON_FOCUSED_HOVER), insets)); 59 *rb.GetImageSkiaNamed(IDR_BLUE_BUTTON_FOCUSED_HOVER), insets));
60 button_border->SetPainter(true, STATE_PRESSED, 60 button_border->SetPainter(true, STATE_PRESSED,
61 Painter::CreateImagePainter( 61 Painter::CreateImagePainter(
62 *rb.GetImageSkiaNamed(IDR_BLUE_BUTTON_FOCUSED_PRESSED), insets)); 62 *rb.GetImageSkiaNamed(IDR_BLUE_BUTTON_FOCUSED_PRESSED), insets));
63 button_border->SetPainter(true, STATE_DISABLED, 63 button_border->SetPainter(true, STATE_DISABLED,
64 Painter::CreateImagePainter( 64 Painter::CreateImagePainter(
65 *rb.GetImageSkiaNamed(IDR_BLUE_BUTTON_DISABLED), insets)); 65 *rb.GetImageSkiaNamed(IDR_BLUE_BUTTON_DISABLED), insets));
66 }
66 67
68 BlueButton::~BlueButton() {}
69
70 void BlueButton::ResetColorsFromNativeTheme() {
71 LabelButton::ResetColorsFromNativeTheme();
67 if (!gfx::IsInvertedColorScheme()) { 72 if (!gfx::IsInvertedColorScheme()) {
68 for (size_t state = STATE_NORMAL; state < STATE_COUNT; ++state) 73 for (size_t state = STATE_NORMAL; state < STATE_COUNT; ++state)
69 SetTextColor(static_cast<ButtonState>(state), kBlueButtonTextColor); 74 SetTextColor(static_cast<ButtonState>(state), kBlueButtonTextColor);
70 label()->SetShadowColors(kBlueButtonShadowColor, kBlueButtonShadowColor); 75 label()->SetShadowColors(kBlueButtonShadowColor, kBlueButtonShadowColor);
71 label()->SetShadowOffset(0, 1); 76 label()->SetShadowOffset(0, 1);
72 } 77 }
73 } 78 }
74 79
75 BlueButton::~BlueButton() {}
76
77 const char* BlueButton::GetClassName() const { 80 const char* BlueButton::GetClassName() const {
78 return BlueButton::kViewClassName; 81 return BlueButton::kViewClassName;
79 } 82 }
80 83
81 } // namespace views 84 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/button/blue_button.h ('k') | ui/views/controls/button/label_button.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698