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

Side by Side Diff: ui/app_list/views/app_list_background.cc

Issue 578243002: App list: Change some colours to match the new specs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ares-line-not-all-the-way
Patch Set: app_list_background: Fix drawing code so it can draw transparent separator. Created 6 years, 2 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
« no previous file with comments | « ui/app_list/app_list_constants.cc ('k') | ui/app_list/views/folder_header_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/views/app_list_background.h" 5 #include "ui/app_list/views/app_list_background.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.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/core/SkPath.h" 9 #include "third_party/skia/include/core/SkPath.h"
10 #include "ui/app_list/app_list_constants.h" 10 #include "ui/app_list/app_list_constants.h"
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 51
52 SkPaint paint; 52 SkPaint paint;
53 paint.setStyle(SkPaint::kFill_Style); 53 paint.setStyle(SkPaint::kFill_Style);
54 54
55 int contents_top = bounds.y(); 55 int contents_top = bounds.y();
56 views::View* search_box_view = main_view_->search_box_view(); 56 views::View* search_box_view = main_view_->search_box_view();
57 if (main_view_->visible() && search_box_view->visible() && 57 if (main_view_->visible() && search_box_view->visible() &&
58 !app_list::switches::IsExperimentalAppListEnabled()) { 58 !app_list::switches::IsExperimentalAppListEnabled()) {
59 const gfx::Rect search_box_view_bounds = 59 const gfx::Rect search_box_view_bounds =
60 search_box_view->ConvertRectToWidget(search_box_view->GetLocalBounds()); 60 search_box_view->ConvertRectToWidget(search_box_view->GetLocalBounds());
61 gfx::Rect search_box_rect(bounds.x(), 61 gfx::Rect search_box_rect(
62 bounds.y(), 62 bounds.x(),
63 bounds.width(), 63 bounds.y(),
64 search_box_view_bounds.bottom() - bounds.y()); 64 bounds.width(),
65 search_box_view_bounds.bottom() - bounds.y() + kTopSeparatorSize);
65 66
66 paint.setColor(kSearchBoxBackground); 67 paint.setColor(kSearchBoxBackground);
67 canvas->DrawRect(search_box_rect, paint); 68 canvas->DrawRect(search_box_rect, paint);
68 69
69 gfx::Rect separator_rect(search_box_rect); 70 gfx::Rect separator_rect(search_box_rect);
70 separator_rect.set_y(separator_rect.bottom()); 71 separator_rect.Inset(0, search_box_rect.height() - kTopSeparatorSize, 0, 0);
71 separator_rect.set_height(kTopSeparatorSize);
72 canvas->FillRect(separator_rect, kTopSeparatorColor); 72 canvas->FillRect(separator_rect, kTopSeparatorColor);
73 contents_top = separator_rect.bottom(); 73 contents_top = separator_rect.bottom();
74 } 74 }
75 75
76 gfx::Rect contents_rect(bounds.x(), 76 gfx::Rect contents_rect(bounds.x(),
77 contents_top, 77 contents_top,
78 bounds.width(), 78 bounds.width(),
79 bounds.bottom() - contents_top); 79 bounds.bottom() - contents_top);
80 80
81 paint.setColor(kContentsBackgroundColor); 81 paint.setColor(kContentsBackgroundColor);
(...skipping 10 matching lines...) Expand all
92 separator_rect.set_y(contents_view_view_bounds.bottom() - 1); 92 separator_rect.set_y(contents_view_view_bounds.bottom() - 1);
93 separator_rect.set_height(kBottomSeparatorSize); 93 separator_rect.set_height(kBottomSeparatorSize);
94 canvas->FillRect(separator_rect, kBottomSeparatorColor); 94 canvas->FillRect(separator_rect, kBottomSeparatorColor);
95 } 95 }
96 } 96 }
97 97
98 canvas->Restore(); 98 canvas->Restore();
99 } 99 }
100 100
101 } // namespace app_list 101 } // namespace app_list
OLDNEW
« no previous file with comments | « ui/app_list/app_list_constants.cc ('k') | ui/app_list/views/folder_header_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698