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

Unified Diff: ash/system/tray/tray_views.cc

Issue 10546147: ash: Fix the border colors in the uber-tray popup. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merge-tot Created 8 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 | « ash/system/tray/tray_bubble_view.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/system/tray/tray_views.cc
diff --git a/ash/system/tray/tray_views.cc b/ash/system/tray/tray_views.cc
index b000164c25025bd15e5427ed83726b8a75cc8532..818df98cc17dc4ecd74e917757d1da1ad3af8f23 100644
--- a/ash/system/tray/tray_views.cc
+++ b/ash/system/tray/tray_views.cc
@@ -36,6 +36,35 @@ views::View* CreatePopupHeaderButtonsContainer() {
return view;
}
+const int kBorderHeight = 3;
+const SkColor kBorderGradientDark = SkColorSetRGB(0xae, 0xae, 0xae);
+const SkColor kBorderGradientLight = SkColorSetRGB(0xe8, 0xe8, 0xe8);
+
+class SpecialPopupRowBorder : public views::Border {
+ public:
+ SpecialPopupRowBorder()
+ : painter_(views::Painter::CreateVerticalGradient(kBorderGradientDark,
+ kBorderGradientLight)) {
+ }
+
+ virtual ~SpecialPopupRowBorder() {}
+
+ private:
+ virtual void Paint(const views::View& view,
+ gfx::Canvas* canvas) const OVERRIDE {
+ views::Painter::PaintPainterAt(canvas, painter_.get(),
+ gfx::Rect(gfx::Size(view.width(), kBorderHeight)));
+ }
+
+ virtual void GetInsets(gfx::Insets* insets) const OVERRIDE {
+ insets->Set(kBorderHeight, 0, 0, 0);
+ }
+
+ scoped_ptr<views::Painter> painter_;
+
+ DISALLOW_COPY_AND_ASSIGN(SpecialPopupRowBorder);
+};
+
}
////////////////////////////////////////////////////////////////////////////////
@@ -399,8 +428,7 @@ SpecialPopupRow::SpecialPopupRow()
views::Painter::CreateVerticalGradient(
kHeaderBackgroundColorLight,
kHeaderBackgroundColorDark)));
- set_border(views::Border::CreateSolidSidedBorder(2, 0, 0, 0,
- ash::kBorderDarkColor));
+ set_border(new SpecialPopupRowBorder);
SetLayoutManager(
new views::BoxLayout(views::BoxLayout::kHorizontal, 0, 0, 0));
}
« no previous file with comments | « ash/system/tray/tray_bubble_view.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698