| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/app_list/drop_shadow_label.h" | 5 #include "ui/app_list/drop_shadow_label.h" |
| 6 | 6 |
| 7 #include "base/utf_string_conversions.h" | |
| 8 #include "third_party/skia/include/effects/SkGradientShader.h" | |
| 9 #include "ui/gfx/canvas.h" | 7 #include "ui/gfx/canvas.h" |
| 10 #include "ui/gfx/color_utils.h" | |
| 11 #include "ui/gfx/insets.h" | 8 #include "ui/gfx/insets.h" |
| 12 #include "ui/gfx/skbitmap_operations.h" | |
| 13 | |
| 14 using views::Label; | |
| 15 | 9 |
| 16 namespace app_list { | 10 namespace app_list { |
| 17 | 11 |
| 18 DropShadowLabel::DropShadowLabel() { | 12 DropShadowLabel::DropShadowLabel() { |
| 19 } | 13 } |
| 20 | 14 |
| 21 DropShadowLabel::~DropShadowLabel() { | 15 DropShadowLabel::~DropShadowLabel() { |
| 22 } | 16 } |
| 23 | 17 |
| 24 void DropShadowLabel::SetTextShadows(int shadow_count, | 18 void DropShadowLabel::SetTextShadows(int shadow_count, |
| (...skipping 22 matching lines...) Expand all Loading... |
| 47 SkColor text_color = enabled() ? enabled_color() : disabled_color(); | 41 SkColor text_color = enabled() ? enabled_color() : disabled_color(); |
| 48 canvas->DrawStringWithShadows(text, | 42 canvas->DrawStringWithShadows(text, |
| 49 font(), | 43 font(), |
| 50 text_color, | 44 text_color, |
| 51 text_bounds, | 45 text_bounds, |
| 52 flags, | 46 flags, |
| 53 text_shadows_); | 47 text_shadows_); |
| 54 | 48 |
| 55 if (HasFocus() || paint_as_focused()) { | 49 if (HasFocus() || paint_as_focused()) { |
| 56 gfx::Rect focus_bounds = text_bounds; | 50 gfx::Rect focus_bounds = text_bounds; |
| 57 focus_bounds.Inset(-Label::kFocusBorderPadding, | 51 focus_bounds.Inset(-views::Label::kFocusBorderPadding, |
| 58 -Label::kFocusBorderPadding); | 52 -views::Label::kFocusBorderPadding); |
| 59 canvas->DrawFocusRect(focus_bounds); | 53 canvas->DrawFocusRect(focus_bounds); |
| 60 } | 54 } |
| 61 } | 55 } |
| 62 | 56 |
| 63 } // namespace app_list | 57 } // namespace app_list |
| OLD | NEW |