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

Unified Diff: ui/views/controls/tabbed_pane/native_tabbed_pane_views.cc

Issue 10823229: (Views only) Add a gradient background to the tabstrip of the view tabbed pane implementation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Complete a comment in painter.h. Created 8 years, 4 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
Index: ui/views/controls/tabbed_pane/native_tabbed_pane_views.cc
diff --git a/ui/views/controls/tabbed_pane/native_tabbed_pane_views.cc b/ui/views/controls/tabbed_pane/native_tabbed_pane_views.cc
index 2a1b447c4fd82e290c875abac6f7b6e0ee7904bc..80c516417e759bf7efbe249eeede0d0e08de27d8 100644
--- a/ui/views/controls/tabbed_pane/native_tabbed_pane_views.cc
+++ b/ui/views/controls/tabbed_pane/native_tabbed_pane_views.cc
@@ -124,6 +124,17 @@ class TabStrip : public View {
explicit TabStrip(NativeTabbedPaneViews* owner)
: owner_(owner),
selected_tab_(NULL) {
+ const int kCount = 4;
+ SkColor colors[] = {
msw 2012/08/08 23:13:53 nit: mention where these values were derived from?
markusheintz_ 2012/08/09 01:00:15 Done.
+ SkColorSetRGB(0xff, 0xff, 0xff),
+ SkColorSetRGB(0xff, 0xff, 0xff),
+ SkColorSetRGB(0xfa, 0xfa, 0xfa),
+ SkColorSetRGB(0xf2, 0xf2, 0xf2)
+ };
+
+ SkScalar pos[4] = {0.0f, 0.6f, 0.8f, 1.0f};
+ set_background(Background::CreateVerticalMultiColorGradientBackground(
+ colors, pos, kCount));
}
virtual ~TabStrip() {}
@@ -167,6 +178,8 @@ class TabStrip : public View {
}
}
virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE {
+ OnPaintBackground(canvas);
+ // Draw the TabStrip border.
msw 2012/08/08 23:13:53 nit: blank line above (separate bg / border).
markusheintz_ 2012/08/09 01:00:15 Done.
SkPaint paint;
paint.setColor(kTabBorderColor);
paint.setStrokeWidth(kTabBorderThickness);

Powered by Google App Engine
This is Rietveld 408576698