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 c925f73852fafc5465e8934f0c5840533e90ac71..68e78e3259b5c910f79e4b8a88a0101b5a04e9ae 100644 |
--- a/ui/app_list/views/search_result_page_view.cc |
+++ b/ui/app_list/views/search_result_page_view.cc |
@@ -9,13 +9,38 @@ |
#include "ui/app_list/views/app_list_main_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/views/background.h" |
#include "ui/views/layout/box_layout.h" |
+#include "ui/views/layout/fill_layout.h" |
+#include "ui/views/shadow_border.h" |
namespace app_list { |
namespace { |
const int kGroupSpacing = 20; |
+const int kTopPadding = 5; |
+ |
+// A container view that ensures the card background and the shadow are painted |
+// in the correct order. |
+class SearchCardView : public views::View { |
+ public: |
+ SearchCardView(views::View* content_view) { |
+ SetBorder(make_scoped_ptr(new views::ShadowBorder( |
+ kCardShadowBlur, kCardShadowColor, kCardShadowYOffset, 0))); |
+ SetLayoutManager(new views::FillLayout()); |
+ content_view->set_background( |
+ views::Background::CreateSolidBackground(kCardBackgroundColor)); |
+ AddChildView(content_view); |
+ } |
+ |
+ ~SearchCardView() override {} |
+ |
+ void ChildPreferredSizeChanged(views::View* child) override { |
+ Layout(); |
+ PreferredSizeChanged(); |
+ } |
+}; |
} // namespace |
@@ -25,14 +50,14 @@ SearchResultPageView::SearchResultPageView(AppListMainView* app_list_main_view, |
new SearchResultListView(app_list_main_view, view_delegate)), |
tiles_view_(new SearchResultTileItemListView()) { |
SetLayoutManager(new views::BoxLayout(views::BoxLayout::kVertical, |
- kExperimentalWindowPadding, 0, |
+ kExperimentalWindowPadding, kTopPadding, |
kGroupSpacing)); |
// The view containing the search results. |
- AddChildView(results_view_); |
+ AddChildView(new SearchCardView(results_view_)); |
// The view containing the start page tiles. |
- AddChildView(tiles_view_); |
+ AddChildView(new SearchCardView(tiles_view_)); |
AppListModel::SearchResults* model = view_delegate->GetModel()->results(); |
results_view_->SetResults(model); |