Chromium Code Reviews| Index: ui/app_list/views/folder_header_view.cc |
| diff --git a/ui/app_list/views/folder_header_view.cc b/ui/app_list/views/folder_header_view.cc |
| index f56a6de131c23bcd3deeec0f6c9d7e8f9119b8ec..01041a075b724c911d2fb361618e570040b53920 100644 |
| --- a/ui/app_list/views/folder_header_view.cc |
| +++ b/ui/app_list/views/folder_header_view.cc |
| @@ -9,6 +9,7 @@ |
| #include "base/strings/utf_string_conversions.h" |
| #include "ui/app_list/app_list_constants.h" |
| #include "ui/app_list/app_list_folder_item.h" |
| +#include "ui/app_list/app_list_switches.h" |
| #include "ui/app_list/views/app_list_folder_view.h" |
| #include "ui/base/resource/resource_bundle.h" |
| #include "ui/gfx/canvas.h" |
| @@ -26,8 +27,8 @@ namespace { |
| const int kPreferredWidth = 360; |
| const int kPreferredHeight = 48; |
| const int kIconDimension = 24; |
| -const int kPadding = 14; |
| -const int kBottomSeparatorPadding = 9; |
| +const int kBackButtonPadding = 14; |
| +const int kBottomSeparatorPadding = 9; // Non-experimental app list only. |
| const int kBottomSeparatorHeight = 1; |
| const int kMaxFolderNameWidth = 300; |
| @@ -158,7 +159,13 @@ void FolderHeaderView::Layout() { |
| return; |
| gfx::Rect back_bounds(rect); |
| - back_bounds.set_width(kIconDimension + 2 * kPadding); |
| + back_bounds.set_width(kIconDimension + 2 * kBackButtonPadding); |
| + if (app_list::switches::IsExperimentalAppListEnabled()) { |
| + // Align the left edge of the button image with the left margin of the |
| + // launcher window. Note that this means the physical button dimensions |
| + // extends slightly into the margin. |
| + back_bounds.set_x(kExperimentalWindowPadding - kBackButtonPadding); |
| + } |
| back_button_->SetBoundsRect(back_bounds); |
| gfx::Rect text_bounds(rect); |
| @@ -192,9 +199,12 @@ void FolderHeaderView::OnPaint(gfx::Canvas* canvas) { |
| return; |
| // Draw bottom separator line. |
| - rect.set_x(kBottomSeparatorPadding); |
| + int horizontal_padding = app_list::switches::IsExperimentalAppListEnabled() |
| + ? kExperimentalWindowPadding |
| + : kBottomSeparatorPadding; |
| + rect.set_x(horizontal_padding); |
| rect.set_y(rect.y() + rect.height() - kBottomSeparatorHeight); |
|
calamity
2014/09/19 05:10:56
Use rect.bottom().
Matt Giuca
2014/09/19 09:56:05
Done.
|
| - rect.set_width(rect.width() - kBottomSeparatorPadding * 2); |
| + rect.set_width(rect.width() - horizontal_padding * 2); |
|
calamity
2014/09/19 05:10:56
Use Rect::Inset().
Matt Giuca
2014/09/19 09:56:05
Done.
|
| rect.set_height(kBottomSeparatorHeight); |
| canvas->FillRect(rect, kTopSeparatorColor); |
| } |