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

Side by Side Diff: ui/views/controls/combobox/combobox.cc

Issue 2327673003: combobox: don't animate state changes in TransparentButton (Closed)
Patch Set: Created 4 years, 3 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/views/controls/combobox/combobox.h" 5 #include "ui/views/controls/combobox/combobox.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <utility> 9 #include <utility>
10 10
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 109
110 bounds.ClampToCenteredSize(arrow_size); 110 bounds.ClampToCenteredSize(arrow_size);
111 return bounds; 111 return bounds;
112 } 112 }
113 113
114 // The transparent button which holds a button state but is not rendered. 114 // The transparent button which holds a button state but is not rendered.
115 class TransparentButton : public CustomButton { 115 class TransparentButton : public CustomButton {
116 public: 116 public:
117 TransparentButton(ButtonListener* listener) 117 TransparentButton(ButtonListener* listener)
118 : CustomButton(listener) { 118 : CustomButton(listener) {
119 SetAnimationDuration(LabelButton::kHoverAnimationDurationMs); 119 SetAnimationDuration(LabelButton::kHoverAnimationDurationMs);
Evan Stade 2016/09/09 18:37:13 why is this here?
Elly Fong-Jones 2016/09/12 11:46:40 Your guess is as good as mine. It was added in the
Evan Stade 2016/09/12 14:51:17 It seems the line you're adding defeats the purpos
120 SetFocusBehavior(FocusBehavior::NEVER); 120 SetFocusBehavior(FocusBehavior::NEVER);
121 set_notify_action(PlatformStyle::kMenuNotifyActivationAction); 121 set_notify_action(PlatformStyle::kMenuNotifyActivationAction);
122 set_animate_on_state_change(false);
122 123
123 if (UseMd()) { 124 if (UseMd()) {
124 SetInkDropMode(PlatformStyle::kUseRipples ? InkDropMode::ON 125 SetInkDropMode(PlatformStyle::kUseRipples ? InkDropMode::ON
125 : InkDropMode::OFF); 126 : InkDropMode::OFF);
126 set_has_ink_drop_action_on_click(true); 127 set_has_ink_drop_action_on_click(true);
127 } 128 }
128 } 129 }
129 ~TransparentButton() override {} 130 ~TransparentButton() override {}
130 131
131 bool OnMousePressed(const ui::MouseEvent& mouse_event) override { 132 bool OnMousePressed(const ui::MouseEvent& mouse_event) override {
(...skipping 857 matching lines...) Expand 10 before | Expand all | Expand 10 after
989 } 990 }
990 991
991 int Combobox::GetArrowContainerWidth() const { 992 int Combobox::GetArrowContainerWidth() const {
992 int padding = style_ == STYLE_NORMAL 993 int padding = style_ == STYLE_NORMAL
993 ? PlatformStyle::kComboboxNormalArrowPadding * 2 994 ? PlatformStyle::kComboboxNormalArrowPadding * 2
994 : kActionLeftPadding + kActionRightPadding; 995 : kActionLeftPadding + kActionRightPadding;
995 return ArrowSize().width() + padding; 996 return ArrowSize().width() + padding;
996 } 997 }
997 998
998 } // namespace views 999 } // namespace views
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698