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

Unified Diff: ui/app_list/views/search_box_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.h ('k') | ui/app_list/views/search_result_page_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_box_view.cc
diff --git a/ui/app_list/views/search_box_view.cc b/ui/app_list/views/search_box_view.cc
index 592212336c287c5403cb5820cc62a0b8fe3ede6a..df8babf59399462cc0c74128812203f053dda60f 100644
--- a/ui/app_list/views/search_box_view.cc
+++ b/ui/app_list/views/search_box_view.cc
@@ -44,10 +44,6 @@ const int kMenuXOffsetFromButton = -7;
const int kBackgroundBorderCornerRadius = 2;
-const int kShadowBlur = 4;
-const int kShadowYOffset = 2;
-const SkColor kShadowColor = SkColorSetARGB(0x33, 0, 0, 0);
-
// A background that paints a solid white rounded rect with a thin grey border.
class ExperimentalSearchBoxBackground : public views::Background {
public:
@@ -86,8 +82,7 @@ SearchBoxView::SearchBoxView(SearchBoxViewDelegate* delegate,
AddChildView(content_container_);
if (switches::IsExperimentalAppListEnabled()) {
- SetBorder(make_scoped_ptr(new views::ShadowBorder(gfx::ShadowValue(
- gfx::Point(0, kShadowYOffset), kShadowBlur, kShadowColor))));
+ SetShadow(GetShadowForZHeight(1));
back_button_ = new views::ImageButton(this);
ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
back_button_->SetImage(
@@ -176,10 +171,15 @@ void SearchBoxView::InvalidateMenu() {
menu_.reset();
}
+void SearchBoxView::SetShadow(const gfx::ShadowValue& shadow) {
+ SetBorder(make_scoped_ptr(new views::ShadowBorder(shadow)));
+ Layout();
+}
+
gfx::Rect SearchBoxView::GetViewBoundsForSearchBoxContentsBounds(
const gfx::Rect& rect) const {
gfx::Rect view_bounds = rect;
- view_bounds.Inset(GetInsets().Scale(-1));
+ view_bounds.Inset(-GetInsets());
return view_bounds;
}
« no previous file with comments | « ui/app_list/views/search_box_view.h ('k') | ui/app_list/views/search_result_page_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698