Index: ui/views/controls/menu/menu_scroll_view_container.cc |
diff --git a/ui/views/controls/menu/menu_scroll_view_container.cc b/ui/views/controls/menu/menu_scroll_view_container.cc |
index 0bc133e8d59ef99c307d0c61577a9ed484671b69..66856811c68cf6c229ba41e3f4b62c8730f9559b 100644 |
--- a/ui/views/controls/menu/menu_scroll_view_container.cc |
+++ b/ui/views/controls/menu/menu_scroll_view_container.cc |
@@ -20,6 +20,9 @@ |
#include "ui/views/controls/menu/menu_item_view.h" |
#include "ui/views/controls/menu/submenu_view.h" |
+#include "third_party/skia/include/core/SkPath.h" |
Ben Goodger (Google)
2012/07/12 03:12:45
sort with others
oshima
2012/07/12 04:00:19
Done.
|
+#include "third_party/skia/include/core/SkPaint.h" |
+ |
using ui::NativeTheme; |
// Height of the scroll arrow. |
@@ -93,13 +96,28 @@ class MenuScrollButton : public View { |
// Then the arrow. |
int x = width() / 2; |
int y = (height() - config.scroll_arrow_height) / 2; |
- int delta_y = 1; |
+ |
+ int x_left = x - config.scroll_arrow_height; |
+ int x_right = x + config.scroll_arrow_height; |
+ int y_bottom; |
+ |
if (!is_up_) { |
- delta_y = -1; |
- y += config.scroll_arrow_height; |
+ y_bottom = y; |
+ y = y_bottom + config.scroll_arrow_height; |
+ } else { |
+ y_bottom = y + config.scroll_arrow_height; |
} |
- for (int i = 0; i < config.scroll_arrow_height; ++i, --x, y += delta_y) |
- canvas->FillRect(gfx::Rect(x, y, (i * 2) + 1, 1), arrow_color); |
+ SkPath path; |
+ path.setFillType(SkPath::kWinding_FillType); |
+ path.moveTo(SkIntToScalar(x), SkIntToScalar(y)); |
+ path.lineTo(SkIntToScalar(x_left), SkIntToScalar(y_bottom)); |
+ path.lineTo(SkIntToScalar(x_right), SkIntToScalar(y_bottom)); |
+ path.lineTo(SkIntToScalar(x), SkIntToScalar(y)); |
+ SkPaint paint; |
+ paint.setStyle(SkPaint::kFill_Style); |
+ paint.setAntiAlias(true); |
+ paint.setColor(arrow_color); |
+ canvas->DrawPath(path, paint); |
} |
private: |