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

Side by Side Diff: ui/app_list/app_list_bubble_border.cc

Issue 10383199: app_list: Update colors and sizes for v2. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | ui/app_list/app_list_item_view.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/app_list/app_list_bubble_border.h" 5 #include "ui/app_list/app_list_bubble_border.h"
6 6
7 #include "third_party/skia/include/core/SkPath.h" 7 #include "third_party/skia/include/core/SkPath.h"
8 #include "third_party/skia/include/core/SkPaint.h" 8 #include "third_party/skia/include/core/SkPaint.h"
9 #include "third_party/skia/include/effects/SkBlurDrawLooper.h" 9 #include "third_party/skia/include/effects/SkBlurDrawLooper.h"
10 #include "third_party/skia/include/effects/SkGradientShader.h" 10 #include "third_party/skia/include/effects/SkGradientShader.h"
11 #include "ui/gfx/canvas.h" 11 #include "ui/gfx/canvas.h"
12 12
13 namespace { 13 namespace {
14 14
15 // Bubble border corner radius.
15 const int kCornerRadius = 3; 16 const int kCornerRadius = 3;
16 17
18 // Arrow width and height.
17 const int kArrowHeight = 10; 19 const int kArrowHeight = 10;
18 const int kArrowWidth = 20; 20 const int kArrowWidth = 20;
19 21
22 // Bubble border color and width.
20 const SkColor kBorderColor = SkColorSetARGB(0xFF, 0, 0, 0); 23 const SkColor kBorderColor = SkColorSetARGB(0xFF, 0, 0, 0);
21 const int kBorderSize = 1; 24 const int kBorderSize = 1;
22 25
26 // Bubble shadow color and radius.
23 const SkColor kShadowColor = SkColorSetARGB(0xFF, 0, 0, 0); 27 const SkColor kShadowColor = SkColorSetARGB(0xFF, 0, 0, 0);
24 const int kShadowRadius = 4; 28 const int kShadowRadius = 4;
25 29
26 const SkColor kModelViewGradientColor1 = SkColorSetARGB(0xFF, 0xFE, 0xFE, 0xFE); 30 // Colors and sizes of top separator between searchbox and grid view.
27 const SkColor kModelViewGradientColor2 = SkColorSetARGB(0xFF, 0xF8, 0xF8, 0xF8); 31 const SkColor kTopSeparatorColor = SkColorSetRGB(0xDB, 0xDB, 0xDB);
28 const int kModelViewGradientSize = 10; 32 const int kTopSeparatorSize = 1;
33 const SkColor kTopSeparatorGradientColor1 = SkColorSetRGB(0xEF, 0xEF, 0xEF);
34 const SkColor kTopSeparatorGradientColor2 = SkColorSetRGB(0xF9, 0xF9, 0xF9);
35 const int kTopSeparatorGradientSize = 9;
29 36
30 const SkColor kFooterBorderGradientColor1 = 37 // Colors and sizes of bottom separator bwtween grid view and page switcher.
31 SkColorSetARGB(0xFF, 0xA0, 0xA0, 0xA0); 38 const SkColor kFooterBorderGradientColor1 = SkColorSetRGB(0x9F, 0x9F, 0x9F);
32 const SkColor kFooterBorderGradientColor2 = 39 const SkColor kFooterBorderGradientColor2 = SkColorSetRGB(0xD9, 0xD9, 0xD9);
33 SkColorSetARGB(0xFF, 0xD4, 0xD4, 0xD4);
34 const int kFooterBorderSize = 3; 40 const int kFooterBorderSize = 3;
35 const SkColor kFooterBackground = SkColorSetARGB(0xFF, 0xDC, 0xDC, 0xDC); 41 const SkColor kFooterBackground = SkColorSetRGB(0xD9, 0xD9, 0xD9);
36 42
37 // TODO(xiyuan): Merge this with the one in skia_util. 43 // TODO(xiyuan): Merge this with the one in skia_util.
38 SkShader* CreateVerticalGradientShader(int start_point, 44 SkShader* CreateVerticalGradientShader(int start_point,
39 int end_point, 45 int end_point,
40 SkColor start_color, 46 SkColor start_color,
41 SkColor end_color, 47 SkColor end_color,
42 SkShader::TileMode mode) { 48 SkShader::TileMode mode) {
43 SkColor grad_colors[2] = { start_color, end_color}; 49 SkColor grad_colors[2] = { start_color, end_color};
44 SkPoint grad_points[2]; 50 SkPoint grad_points[2];
45 grad_points[0].iset(0, start_point); 51 grad_points[0].iset(0, start_point);
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 gfx::Canvas* canvas, 107 gfx::Canvas* canvas,
102 const gfx::Rect& bounds) const { 108 const gfx::Rect& bounds) const {
103 const views::View* page_switcher = app_list_view_->child_at(1); 109 const views::View* page_switcher = app_list_view_->child_at(1);
104 const gfx::Rect page_switcher_bounds = 110 const gfx::Rect page_switcher_bounds =
105 app_list_view_->ConvertRectToWidget(page_switcher->bounds()); 111 app_list_view_->ConvertRectToWidget(page_switcher->bounds());
106 gfx::Rect rect(bounds.x(), 112 gfx::Rect rect(bounds.x(),
107 bounds.y(), 113 bounds.y(),
108 bounds.width(), 114 bounds.width(),
109 page_switcher_bounds.y() - bounds.y()); 115 page_switcher_bounds.y() - bounds.y());
110 116
117 // TODO(xiyuan): Draw 1px separator line after SearchBoxView is added.
118
111 SkPaint paint; 119 SkPaint paint;
112 paint.setStyle(SkPaint::kFill_Style); 120 paint.setStyle(SkPaint::kFill_Style);
113 SkSafeUnref(paint.setShader(CreateVerticalGradientShader( 121 SkSafeUnref(paint.setShader(CreateVerticalGradientShader(
114 rect.y(), 122 rect.y(),
115 rect.y() + kModelViewGradientSize, 123 rect.y() + kTopSeparatorGradientSize,
116 kModelViewGradientColor1, 124 kTopSeparatorGradientColor1,
117 kModelViewGradientColor2, 125 kTopSeparatorGradientColor2,
118 SkShader::kClamp_TileMode))); 126 SkShader::kClamp_TileMode)));
119 canvas->DrawRect(rect, paint); 127 canvas->DrawRect(rect, paint);
120 } 128 }
121 129
122 void AppListBubbleBorder::PaintPageSwitcherBackground( 130 void AppListBubbleBorder::PaintPageSwitcherBackground(
123 gfx::Canvas* canvas, 131 gfx::Canvas* canvas,
124 const gfx::Rect& bounds) const { 132 const gfx::Rect& bounds) const {
125 const views::View* page_switcher = app_list_view_->child_at(1); 133 const views::View* page_switcher = app_list_view_->child_at(1);
126 const gfx::Rect page_switcher_bounds = 134 const gfx::Rect page_switcher_bounds =
127 app_list_view_->ConvertRectToWidget(page_switcher->bounds()); 135 app_list_view_->ConvertRectToWidget(page_switcher->bounds());
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 canvas->Save(); 212 canvas->Save();
205 canvas->ClipPath(path); 213 canvas->ClipPath(path);
206 214
207 PaintModelViewBackground(canvas, bounds); 215 PaintModelViewBackground(canvas, bounds);
208 PaintPageSwitcherBackground(canvas, bounds); 216 PaintPageSwitcherBackground(canvas, bounds);
209 217
210 canvas->Restore(); 218 canvas->Restore();
211 } 219 }
212 220
213 } // namespace app_list 221 } // namespace app_list
OLDNEW
« no previous file with comments | « no previous file | ui/app_list/app_list_item_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698