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

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

Issue 889593003: Animate the app list search box shadow. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@fix_animations
Patch Set: move GetShadowForZHeight to app_list_constants.cc Created 5 years, 10 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/search_box_view.cc ('k') | ui/app_list/views/speech_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/app_list/views/search_result_page_view.cc
diff --git a/ui/app_list/views/search_result_page_view.cc b/ui/app_list/views/search_result_page_view.cc
index 4a09e9af8ca874a11f327045fa2728361d77f7eb..f77c722986856ba161bfe18d78b1e8dd27bf6476 100644
--- a/ui/app_list/views/search_result_page_view.cc
+++ b/ui/app_list/views/search_result_page_view.cc
@@ -8,6 +8,7 @@
#include "ui/app_list/app_list_switches.h"
#include "ui/app_list/app_list_view_delegate.h"
#include "ui/app_list/views/app_list_main_view.h"
+#include "ui/app_list/views/search_box_view.h"
#include "ui/app_list/views/search_result_list_view.h"
#include "ui/app_list/views/search_result_tile_item_list_view.h"
#include "ui/gfx/shadow_value.h"
@@ -28,9 +29,7 @@ const int kTopPadding = 5;
class SearchCardView : public views::View {
public:
explicit SearchCardView(views::View* content_view) {
- SetBorder(make_scoped_ptr(new views::ShadowBorder(
- gfx::ShadowValue(gfx::Point(0, kCardShadowYOffset), kCardShadowBlur,
- kCardShadowColor))));
+ SetBorder(make_scoped_ptr(new views::ShadowBorder(GetShadowForZHeight(1))));
SetLayoutManager(new views::FillLayout());
content_view->set_background(
views::Background::CreateSolidBackground(kCardBackgroundColor));
@@ -49,9 +48,18 @@ class SearchCardView : public views::View {
SearchResultPageView::SearchResultPageView() : selected_index_(0) {
if (switches::IsExperimentalAppListEnabled()) {
- SetLayoutManager(new views::BoxLayout(views::BoxLayout::kVertical,
- kExperimentalWindowPadding,
- kTopPadding, kGroupSpacing));
+ gfx::ShadowValue shadow = GetShadowForZHeight(1);
+ scoped_ptr<views::Border> border(new views::ShadowBorder(shadow));
+
+ gfx::Insets insets = gfx::Insets(kTopPadding, kExperimentalWindowPadding, 0,
+ kExperimentalWindowPadding);
+ insets += -border->GetInsets();
+
+ views::BoxLayout* layout =
+ new views::BoxLayout(views::BoxLayout::kVertical, 0, 0, kGroupSpacing);
+ layout->set_inside_border_insets(insets);
+
+ SetLayoutManager(layout);
} else {
SetLayoutManager(new views::FillLayout);
}
« no previous file with comments | « ui/app_list/views/search_box_view.cc ('k') | ui/app_list/views/speech_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698