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

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: Remove unnecessary curly braces 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
« no previous file with comments | « ui/views/background.cc ('k') | ui/views/painter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..6a7bc1d4ca32541e7a32c35aede71eb3baa421f0 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,20 @@ class TabStrip : public View {
explicit TabStrip(NativeTabbedPaneViews* owner)
: owner_(owner),
selected_tab_(NULL) {
+ const int kCount = 4;
+ // The gradient colors are derived from the tabbed panes used for the
+ // WebUI.
+ SkColor colors[] = {
+ SkColorSetRGB(0xff, 0xff, 0xff),
+ SkColorSetRGB(0xff, 0xff, 0xff),
+ SkColorSetRGB(0xfa, 0xfa, 0xfa),
+ SkColorSetRGB(0xf2, 0xf2, 0xf2)
+ };
+ // The relative positions of the gradient colors are derived from the
+ // tabbed panes used for the WebUI.
+ SkScalar pos[4] = {0.0f, 0.6f, 0.8f, 1.0f};
+ set_background(Background::CreateVerticalMultiColorGradientBackground(
+ colors, pos, kCount));
}
virtual ~TabStrip() {}
@@ -167,6 +181,9 @@ class TabStrip : public View {
}
}
virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE {
+ OnPaintBackground(canvas);
+
+ // Draw the TabStrip border.
SkPaint paint;
paint.setColor(kTabBorderColor);
paint.setStrokeWidth(kTabBorderThickness);
« no previous file with comments | « ui/views/background.cc ('k') | ui/views/painter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698