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

Unified Diff: ui/app_list/views/folder_header_view.cc

Issue 578223002: Experimental app list: Enforce a 24-pixel padding on the top and sides. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ares-folder-heading-line-width
Patch Set: Created 6 years, 3 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
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);
}
« ui/app_list/views/app_list_background.cc ('K') | « ui/app_list/views/app_list_main_view.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698