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

Unified Diff: ui/views/animation/ink_drop_host_view.h

Issue 2665073002: Allow ripple hover/press effects to be more easily sized by subclasses. (Closed)
Patch Set: Review comment, compile fix Created 3 years, 11 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 | « no previous file | ui/views/animation/ink_drop_host_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/animation/ink_drop_host_view.h
diff --git a/ui/views/animation/ink_drop_host_view.h b/ui/views/animation/ink_drop_host_view.h
index eb442da765e5110dbf5b98f16444cb29a20e6714..9ca595524686d22857cbbb93097ed6b447f03fb3 100644
--- a/ui/views/animation/ink_drop_host_view.h
+++ b/ui/views/animation/ink_drop_host_view.h
@@ -54,8 +54,11 @@ class VIEWS_EXPORT InkDropHostView : public View, public InkDropHost {
void SetInkDropMode(InkDropMode ink_drop_mode);
protected:
- static const int kInkDropSmallCornerRadius;
- static const int kInkDropLargeCornerRadius;
+ static constexpr int kInkDropSmallCornerRadius = 2;
+ static constexpr int kInkDropLargeCornerRadius = 4;
+
+ // Size used for the default SquareInkDropRipple.
+ static constexpr int kDefaultInkDropSize = 24;
// Returns a large ink drop size based on the |small_size| that works well
// with the SquareInkDropRipple animation durations.
@@ -68,11 +71,15 @@ class VIEWS_EXPORT InkDropHostView : public View, public InkDropHost {
// Returns the default InkDropRipple centered on |center_point|.
std::unique_ptr<InkDropRipple> CreateDefaultInkDropRipple(
- const gfx::Point& center_point) const;
+ const gfx::Point& center_point,
+ const gfx::Size& size = gfx::Size(kDefaultInkDropSize,
+ kDefaultInkDropSize)) const;
// Returns the default InkDropHighlight centered on |center_point|.
std::unique_ptr<InkDropHighlight> CreateDefaultInkDropHighlight(
- const gfx::PointF& center_point) const;
+ const gfx::PointF& center_point,
+ const gfx::Size& size = gfx::Size(kDefaultInkDropSize,
+ kDefaultInkDropSize)) const;
// Returns the point of the |last_ripple_triggering_event_| if it was a
// LocatedEvent, otherwise the center point of the local bounds is returned.
« no previous file with comments | « no previous file | ui/views/animation/ink_drop_host_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698