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

Unified Diff: ui/views/controls/label.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/label.h ('k') | ui/views/examples/label_example.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/label.cc
diff --git a/ui/views/controls/label.cc b/ui/views/controls/label.cc
index 00bc751f62c9d44aca234e124d92194d4005bab5..648a0e660bcfd986d92ff25d08f8959f606297db 100644
--- a/ui/views/controls/label.cc
+++ b/ui/views/controls/label.cc
@@ -321,11 +321,6 @@ void Label::PaintText(gfx::Canvas* canvas,
} else {
canvas->DrawStringRectWithShadows(text, font_list_, color, text_bounds,
line_height_, flags, shadows_);
-
- if (SkColorGetA(halo_color_) != SK_AlphaTRANSPARENT) {
- canvas->DrawStringRectWithHalo(text, font_list_, color, halo_color_,
- text_bounds, flags);
- }
}
if (HasFocus()) {
@@ -352,6 +347,8 @@ gfx::Size Label::GetTextSize() const {
gfx::Canvas::SizeStringInt(
layout_text(), font_list_, &w, &h, line_height_, flags);
text_size_.SetSize(w, h);
+ const gfx::Insets shadow_margin = -gfx::ShadowValue::GetMargin(shadows_);
+ text_size_.Enlarge(shadow_margin.width(), shadow_margin.height());
text_size_valid_ = true;
}
@@ -394,7 +391,6 @@ void Label::Init(const base::string16& text, const gfx::FontList& font_list) {
elide_behavior_ = gfx::ELIDE_TAIL;
collapse_when_hidden_ = false;
directionality_mode_ = gfx::DIRECTIONALITY_FROM_UI;
- halo_color_ = SK_ColorTRANSPARENT;
cached_heights_.resize(kCachedSizeLimit);
ResetCachedSize();
« no previous file with comments | « ui/views/controls/label.h ('k') | ui/views/examples/label_example.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698