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

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

Issue 1761443003: [MD] simplify and unify some ink drop center calculations (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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/controls/button/label_button.cc
diff --git a/ui/views/controls/button/label_button.cc b/ui/views/controls/button/label_button.cc
index f192e1282b258644d0a913accb63245831b2b5e4..c65bc2036cb5007b318b16fa06b5f5f34a02a6ad 100644
--- a/ui/views/controls/button/label_button.cc
+++ b/ui/views/controls/button/label_button.cc
@@ -420,8 +420,6 @@ void LabelButton::RemoveInkDropLayer(ui::Layer* ink_drop_layer) {
scoped_ptr<views::InkDropAnimation> LabelButton::CreateInkDropAnimation()
const {
- // TODO(bruthig): Make the flood fill ink drops centered on the LocatedEvent
- // that triggered them.
return GetText().empty()
? CustomButton::CreateInkDropAnimation()
: make_scoped_ptr(new views::FloodFillInkDropAnimation(
@@ -437,6 +435,13 @@ scoped_ptr<views::InkDropHover> LabelButton::CreateInkDropHover() const {
size(), 0, GetInkDropCenter(), GetInkDropBaseColor()));
}
+gfx::Point LabelButton::GetInkDropCenter() const {
+ // TODO(bruthig): Make the flood fill ink drops centered on the LocatedEvent
+ // that triggered them.
+ return GetText().empty() ? image()->bounds().CenterPoint()
varkha 2016/03/03 05:51:47 I think you need to do something like this: gfx:
+ : CustomButton::GetInkDropCenter();
+}
+
void LabelButton::StateChanged() {
const gfx::Size previous_image_size(image_->GetPreferredSize());
UpdateImage();
« chrome/browser/ui/views/toolbar/app_menu_button.cc ('K') | « ui/views/controls/button/label_button.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698