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

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

Issue 516943003: Add textfield internal padding from FocusableBorder. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update AppList's SearchBoxView and FolderHeaderView; git cl format. 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 58c54b832e22ad0dcfbb553a2d613dcf998d9846..931692a348f7224383f63a3df6f4d26c8f1d20c7 100644
--- a/ui/app_list/views/folder_header_view.cc
+++ b/ui/app_list/views/folder_header_view.cc
@@ -167,7 +167,8 @@ void FolderHeaderView::Layout() {
: folder_name_placeholder_text_;
int text_width =
gfx::Canvas::GetStringWidth(text, folder_name_view_->GetFontList()) +
- folder_name_view_->GetCaretBounds().width();
+ folder_name_view_->GetCaretBounds().width() +
+ 2 * views::Textfield::kTextPadding;
Peter Kasting 2014/09/05 22:56:49 Can this be calculated by setting |folder_name_vie
msw 2014/09/05 23:46:55 The preferred size of a textfield does not depend
text_width = std::min(text_width, kMaxFolderNameWidth);
text_bounds.set_x(back_bounds.x() + (rect.width() - text_width) / 2);
text_bounds.set_width(text_width);

Powered by Google App Engine
This is Rietveld 408576698