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

Unified Diff: ui/views/animation/ink_drop_hover.cc

Issue 1682893002: Color the ink drop ripple and hover effects based on theming. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix unit tests Created 4 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
Index: ui/views/animation/ink_drop_hover.cc
diff --git a/ui/views/animation/ink_drop_hover.cc b/ui/views/animation/ink_drop_hover.cc
index 439ee24f444f45df3e4935032f29bc3620eb5662..27becb67fc380857b864d6da0dac8c9311d9bb90 100644
--- a/ui/views/animation/ink_drop_hover.cc
+++ b/ui/views/animation/ink_drop_hover.cc
@@ -16,19 +16,18 @@ namespace views {
namespace {
// The opacity of the hover when it is visible.
-const float kHoverVisibleOpacity = 0.08f;
Evan Stade 2016/02/09 20:39:28 I used algebra for these conversions
bruthig 2016/02/09 21:01:06 Do you think we'll have to parameterize these in t
Evan Stade 2016/02/09 22:54:28 no
+const float kHoverVisibleOpacity = 0.128f;
// The opacity of the hover when it is not visible.
const float kHiddenOpacity = 0.0f;
-// The hover color.
-const SkColor kHoverColor = SK_ColorBLACK;
-
} // namespace
-InkDropHover::InkDropHover(const gfx::Size& size, int corner_radius)
+InkDropHover::InkDropHover(SkColor color,
+ const gfx::Size& size,
+ int corner_radius)
: layer_delegate_(
- new RoundedRectangleLayerDelegate(kHoverColor, size, corner_radius)),
+ new RoundedRectangleLayerDelegate(color, size, corner_radius)),
layer_(new ui::Layer()) {
layer_->SetBounds(gfx::Rect(size));
layer_->SetFillsBoundsOpaquely(false);
@@ -83,6 +82,10 @@ void InkDropHover::AnimateFade(HoverAnimationType animation_type,
animation_observer->SetActive();
}
+SkColor InkDropHover::GetColor() const {
+ return layer_delegate_->color();
+}
+
void InkDropHover::SetCenterPoint(const gfx::Point& center_point) {
gfx::Transform transform;
transform.Translate(center_point.x() - layer_->bounds().CenterPoint().x(),

Powered by Google App Engine
This is Rietveld 408576698