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

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

Issue 722563002: Add a card background to the app list search result groups. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@tilv
Patch Set: use constants in speech_view.cc Created 6 years, 1 month 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/app_list_constants.cc ('k') | ui/app_list/views/search_result_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 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);
« no previous file with comments | « ui/app_list/app_list_constants.cc ('k') | ui/app_list/views/search_result_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698