OLD | NEW |
---|---|
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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
80 | 80 |
81 paint.setColor(kContentsBackgroundColor); | 81 paint.setColor(kContentsBackgroundColor); |
82 canvas->DrawRect(contents_rect, paint); | 82 canvas->DrawRect(contents_rect, paint); |
83 | 83 |
84 if (app_list::switches::IsExperimentalAppListEnabled()) { | 84 if (app_list::switches::IsExperimentalAppListEnabled()) { |
85 if (main_view_->visible()) { | 85 if (main_view_->visible()) { |
86 views::View* contents_view = main_view_->contents_view(); | 86 views::View* contents_view = main_view_->contents_view(); |
87 const gfx::Rect contents_view_view_bounds = | 87 const gfx::Rect contents_view_view_bounds = |
88 contents_view->ConvertRectToWidget(contents_view->GetLocalBounds()); | 88 contents_view->ConvertRectToWidget(contents_view->GetLocalBounds()); |
89 gfx::Rect separator_rect(contents_rect); | 89 gfx::Rect separator_rect(contents_rect); |
90 separator_rect.set_x(kExperimentalWindowPadding); | |
91 separator_rect.set_width(contents_view_view_bounds.width() - | |
92 kExperimentalWindowPadding * 2); | |
calamity
2014/09/19 05:10:56
Use Rect::Inset()
Matt Giuca
2014/09/19 09:56:05
Done. (Also this was buggy before because it assum
| |
90 separator_rect.set_y(contents_view_view_bounds.bottom()); | 93 separator_rect.set_y(contents_view_view_bounds.bottom()); |
91 separator_rect.set_height(kBottomSeparatorSize); | 94 separator_rect.set_height(kBottomSeparatorSize); |
92 canvas->FillRect(separator_rect, kBottomSeparatorColor); | 95 canvas->FillRect(separator_rect, kBottomSeparatorColor); |
96 | |
93 int contents_switcher_top = separator_rect.bottom(); | 97 int contents_switcher_top = separator_rect.bottom(); |
94 gfx::Rect contents_switcher_rect(bounds.x(), | 98 gfx::Rect contents_switcher_rect(bounds.x(), |
95 contents_switcher_top, | 99 contents_switcher_top, |
96 bounds.width(), | 100 bounds.width(), |
97 bounds.bottom() - contents_switcher_top); | 101 bounds.bottom() - contents_switcher_top); |
98 paint.setColor(kContentsSwitcherBackgroundColor); | 102 paint.setColor(kContentsBackgroundColor); |
99 canvas->DrawRect(contents_switcher_rect, paint); | 103 canvas->DrawRect(contents_switcher_rect, paint); |
calamity
2014/09/19 05:10:56
96-103 is unnecessary now.
Matt Giuca
2014/09/19 09:56:05
Done.
| |
100 } | 104 } |
101 } | 105 } |
102 | 106 |
103 canvas->Restore(); | 107 canvas->Restore(); |
104 } | 108 } |
105 | 109 |
106 } // namespace app_list | 110 } // namespace app_list |
OLD | NEW |