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

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

Issue 458983004: Move app list search result icon sizes to app_list_constants. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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/search_result_view.cc
diff --git a/ui/app_list/views/search_result_view.cc b/ui/app_list/views/search_result_view.cc
index 74e3d7ab262bafdcef071685e5e73c25fbb9a1da..831a1b8b9d62779f21467c2728bc647864fc7741 100644
--- a/ui/app_list/views/search_result_view.cc
+++ b/ui/app_list/views/search_result_view.cc
@@ -25,9 +25,8 @@ namespace {
const int kPreferredWidth = 300;
const int kPreferredHeight = 52;
-const int kIconDimension = 32;
const int kIconPadding = 14;
-const int kIconViewWidth = kIconDimension + 2 * kIconPadding;
+const int kIconViewWidth = kListIconSize + 2 * kIconPadding;
const int kTextTrailPadding = kIconPadding;
const int kBorderSize = 1;
@@ -144,7 +143,7 @@ void SearchResultView::Layout() {
gfx::Rect icon_bounds(rect);
icon_bounds.set_width(kIconViewWidth);
- icon_bounds.Inset(kIconPadding, (rect.height() - kIconDimension) / 2);
+ icon_bounds.Inset(kIconPadding, (rect.height() - kListIconSize) / 2);
icon_bounds.Intersect(rect);
icon_->SetBoundsRect(icon_bounds);
@@ -279,11 +278,11 @@ void SearchResultView::OnIconChanged() {
return;
// Scales down big icons but leave small ones unchanged.
- if (image.width() > kIconDimension || image.height() > kIconDimension) {
+ if (image.width() > kListIconSize || image.height() > kListIconSize) {
image = gfx::ImageSkiaOperations::CreateResizedImage(
image,
skia::ImageOperations::RESIZE_BEST,
- gfx::Size(kIconDimension, kIconDimension));
+ gfx::Size(kListIconSize, kListIconSize));
} else {
icon_->ResetImageSize();
}

Powered by Google App Engine
This is Rietveld 408576698