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

Unified Diff: ui/views/examples/scroll_view_example.cc

Issue 2616273002: Native Themes: Add table header colors (Closed)
Patch Set: Add gradients back Created 3 years, 11 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/controls/table/table_header.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/examples/scroll_view_example.cc
diff --git a/ui/views/examples/scroll_view_example.cc b/ui/views/examples/scroll_view_example.cc
index 4fd1aaa2970948ed351eff7775a654532e9aa837..e6a710cb8ba628666157a428f13d331c5347a11a 100644
--- a/ui/views/examples/scroll_view_example.cc
+++ b/ui/views/examples/scroll_view_example.cc
@@ -7,10 +7,12 @@
#include "base/macros.h"
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
+#include "ui/gfx/color_utils.h"
#include "ui/views/background.h"
#include "ui/views/controls/button/label_button.h"
#include "ui/views/controls/button/radio_button.h"
#include "ui/views/layout/grid_layout.h"
+#include "ui/views/painter.h"
#include "ui/views/view.h"
using base::ASCIIToUTF16;
@@ -33,7 +35,11 @@ class ScrollViewExample::ScrollableView : public View {
}
void SetColor(SkColor from, SkColor to) {
- set_background(Background::CreateVerticalGradientBackground(from, to));
+ Background* background = Background::CreateBackgroundPainter(
+ Painter::CreateVerticalGradient(from, to));
+ background->SetNativeControlColor(
+ color_utils::AlphaBlend(from, to, 128));
+ set_background(background);
}
void PlaceChildY(int index, int y) {
« no previous file with comments | « ui/views/controls/table/table_header.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698