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

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

Issue 343853002: Fix new avatar button appearance regressions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove unused label halo code; update example. Created 6 years, 6 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 | « ui/views/controls/button/label_button.h ('k') | ui/views/controls/label.h » ('j') | 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 3f5196b02a0c11eaa11fb9f3ef9b980383eb9caf..cafb89052fe4463086e95d4665829c88338c3f0a 100644
--- a/ui/views/controls/button/label_button.cc
+++ b/ui/views/controls/button/label_button.cc
@@ -100,8 +100,12 @@ void LabelButton::SetTextColor(ButtonState for_state, SkColor color) {
explicitly_set_colors_[for_state] = true;
}
-void LabelButton::SetHaloColor(SkColor color) {
- label_->set_halo_color(color);
+void LabelButton::SetTextShadows(const gfx::ShadowValues& shadows) {
+ label_->set_shadows(shadows);
+}
+
+void LabelButton::SetTextSubpixelRenderingEnabled(bool enabled) {
+ label_->set_subpixel_rendering_enabled(enabled);
}
bool LabelButton::GetTextMultiLine() const {
@@ -180,6 +184,7 @@ void LabelButton::SetFocusPainter(scoped_ptr<Painter> focus_painter) {
gfx::Size LabelButton::GetPreferredSize() const {
// Use a temporary label copy for sizing to avoid calculation side-effects.
Label label(GetText(), cached_normal_font_list_);
+ label.set_shadows(label_->shadows());
label.SetMultiLine(GetTextMultiLine());
if (style() == STYLE_BUTTON) {
@@ -259,7 +264,7 @@ void LabelButton::Layout() {
}
gfx::Point label_origin(child_area.origin());
- if (!image_size.IsEmpty() &&adjusted_alignment != gfx::ALIGN_RIGHT)
+ if (!image_size.IsEmpty() && adjusted_alignment != gfx::ALIGN_RIGHT)
label_origin.set_x(image_origin.x() + image_size.width() + kSpacing);
image_->SetBoundsRect(gfx::Rect(image_origin, image_size));
« no previous file with comments | « ui/views/controls/button/label_button.h ('k') | ui/views/controls/label.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698