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

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: Rebase. 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
« no previous file with comments | « ui/app_list/views/app_list_main_view.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 c402893224b8fe479cbc54738bd562d565b325aa..9ba4c7e405477840aff2f7ca1bab942644b056ae 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,7 +199,10 @@ void FolderHeaderView::OnPaint(gfx::Canvas* canvas) {
return;
// Draw bottom separator line.
- rect.Inset(kBottomSeparatorPadding, 0);
+ int horizontal_padding = app_list::switches::IsExperimentalAppListEnabled()
+ ? kExperimentalWindowPadding
+ : kBottomSeparatorPadding;
+ rect.Inset(horizontal_padding, 0);
rect.set_y(rect.bottom() - kBottomSeparatorHeight);
rect.set_height(kBottomSeparatorHeight);
canvas->FillRect(rect, kTopSeparatorColor);
« no previous file with comments | « 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