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

Unified Diff: ui/views/controls/button/custom_button.cc

Issue 2028303004: Hide hover effect on hidden ink drop host views. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 7 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/views/animation/test/test_ink_drop_delegate.cc ('k') | ui/views/views.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/button/custom_button.cc
diff --git a/ui/views/controls/button/custom_button.cc b/ui/views/controls/button/custom_button.cc
index 62f048173c68b2de35b20602c71f909c42275b17..d3a8fa62341aa01924ae055844b7e9049779bb37 100644
--- a/ui/views/controls/button/custom_button.cc
+++ b/ui/views/controls/button/custom_button.cc
@@ -130,13 +130,13 @@ void CustomButton::OnEnabledChanged() {
if (enabled() ? (state_ != STATE_DISABLED) : (state_ == STATE_DISABLED))
return;
- if (enabled())
+ if (enabled()) {
SetState(ShouldEnterHoveredState() ? STATE_HOVERED : STATE_NORMAL);
- else
+ if (ink_drop_delegate())
+ ink_drop_delegate()->SetHovered(InDrag() && IsMouseHovered());
bruthig 2016/06/03 14:30:50 Shouldn't this be !InDrag() ? IMO it would be eas
Evan Stade 2016/06/03 17:55:59 fixed
bruthig 2016/06/03 19:42:36 Yeah.
Evan Stade 2016/06/03 21:53:23 But then IsHovered is different from IsMouseHovere
bruthig 2016/06/03 22:35:25 I'd be more concerned if it were the same as it wo
+ } else {
SetState(STATE_DISABLED);
-
- if (ink_drop_delegate())
- ink_drop_delegate()->SetHovered(ShouldShowInkDropHover());
+ }
}
const char* CustomButton::GetClassName() const {
@@ -349,6 +349,7 @@ void CustomButton::GetAccessibleState(ui::AXViewState* state) {
}
void CustomButton::VisibilityChanged(View* starting_from, bool visible) {
+ Button::VisibilityChanged(starting_from, visible);
if (state_ == STATE_DISABLED)
return;
SetState(visible && ShouldEnterHoveredState() ? STATE_HOVERED : STATE_NORMAL);
« no previous file with comments | « ui/views/animation/test/test_ink_drop_delegate.cc ('k') | ui/views/views.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698