| 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/views/controls/combobox/combobox.h" | 5 #include "ui/views/controls/combobox/combobox.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 822 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 833 SkPath path; | 833 SkPath path; |
| 834 // This epsilon makes sure that all the aliasing pixels are slightly more | 834 // This epsilon makes sure that all the aliasing pixels are slightly more |
| 835 // than half full. Otherwise, rounding issues cause some to be considered | 835 // than half full. Otherwise, rounding issues cause some to be considered |
| 836 // slightly less than half full and come out a little lighter. | 836 // slightly less than half full and come out a little lighter. |
| 837 const SkScalar kEpsilon = 0.0001f; | 837 const SkScalar kEpsilon = 0.0001f; |
| 838 path.moveTo(x - kEpsilon, y); | 838 path.moveTo(x - kEpsilon, y); |
| 839 path.rLineTo(height, height); | 839 path.rLineTo(height, height); |
| 840 path.rLineTo(2 * kEpsilon, 0); | 840 path.rLineTo(2 * kEpsilon, 0); |
| 841 path.rLineTo(height, -height); | 841 path.rLineTo(height, -height); |
| 842 path.close(); | 842 path.close(); |
| 843 SkPaint paint; | 843 CdlPaint paint; |
| 844 SkColor arrow_color = GetNativeTheme()->GetSystemColor( | 844 SkColor arrow_color = GetNativeTheme()->GetSystemColor( |
| 845 ui::NativeTheme::kColorId_ButtonEnabledColor); | 845 ui::NativeTheme::kColorId_ButtonEnabledColor); |
| 846 if (!enabled()) | 846 if (!enabled()) |
| 847 arrow_color = SkColorSetA(arrow_color, gfx::kDisabledControlAlpha); | 847 arrow_color = SkColorSetA(arrow_color, gfx::kDisabledControlAlpha); |
| 848 paint.setColor(arrow_color); | 848 paint.setColor(arrow_color); |
| 849 paint.setAntiAlias(true); | 849 paint.setAntiAlias(true); |
| 850 canvas->DrawPath(path, paint); | 850 canvas->DrawPath(path, paint); |
| 851 } else { | 851 } else { |
| 852 canvas->DrawImageInt(arrow_image_, arrow_bounds.x(), arrow_bounds.y()); | 852 canvas->DrawImageInt(arrow_image_, arrow_bounds.x(), arrow_bounds.y()); |
| 853 } | 853 } |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 992 const int kMdPaddingWidth = 8; | 992 const int kMdPaddingWidth = 8; |
| 993 int arrow_pad = UseMd() ? kMdPaddingWidth | 993 int arrow_pad = UseMd() ? kMdPaddingWidth |
| 994 : PlatformStyle::kComboboxNormalArrowPadding; | 994 : PlatformStyle::kComboboxNormalArrowPadding; |
| 995 int padding = style_ == STYLE_NORMAL | 995 int padding = style_ == STYLE_NORMAL |
| 996 ? arrow_pad * 2 | 996 ? arrow_pad * 2 |
| 997 : kActionLeftPadding + kActionRightPadding; | 997 : kActionLeftPadding + kActionRightPadding; |
| 998 return ArrowSize().width() + padding; | 998 return ArrowSize().width() + padding; |
| 999 } | 999 } |
| 1000 | 1000 |
| 1001 } // namespace views | 1001 } // namespace views |
| OLD | NEW |