| OLD | NEW |
| 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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 public: | 116 public: |
| 117 TransparentButton(ButtonListener* listener, bool animate_state_change) | 117 TransparentButton(ButtonListener* listener, bool animate_state_change) |
| 118 : CustomButton(listener) { | 118 : CustomButton(listener) { |
| 119 set_animate_on_state_change(animate_state_change); | 119 set_animate_on_state_change(animate_state_change); |
| 120 if (animate_state_change) | 120 if (animate_state_change) |
| 121 SetAnimationDuration(LabelButton::kHoverAnimationDurationMs); | 121 SetAnimationDuration(LabelButton::kHoverAnimationDurationMs); |
| 122 SetFocusBehavior(FocusBehavior::NEVER); | 122 SetFocusBehavior(FocusBehavior::NEVER); |
| 123 set_notify_action(PlatformStyle::kMenuNotifyActivationAction); | 123 set_notify_action(PlatformStyle::kMenuNotifyActivationAction); |
| 124 | 124 |
| 125 if (UseMd()) { | 125 if (UseMd()) { |
| 126 SetInkDropMode(PlatformStyle::kUseRipples ? InkDropMode::ON | 126 SetInkDropMode(InkDropMode::ON); |
| 127 : InkDropMode::OFF); | |
| 128 set_has_ink_drop_action_on_click(true); | 127 set_has_ink_drop_action_on_click(true); |
| 129 } | 128 } |
| 130 } | 129 } |
| 131 ~TransparentButton() override {} | 130 ~TransparentButton() override {} |
| 132 | 131 |
| 133 bool OnMousePressed(const ui::MouseEvent& mouse_event) override { | 132 bool OnMousePressed(const ui::MouseEvent& mouse_event) override { |
| 134 #if !defined(OS_MACOSX) | 133 #if !defined(OS_MACOSX) |
| 135 // On Mac, comboboxes do not take focus on mouse click, but on other | 134 // On Mac, comboboxes do not take focus on mouse click, but on other |
| 136 // platforms they do. | 135 // platforms they do. |
| 137 parent()->RequestFocus(); | 136 parent()->RequestFocus(); |
| (...skipping 873 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1011 constexpr int kMdPaddingWidth = 8; | 1010 constexpr int kMdPaddingWidth = 8; |
| 1012 constexpr int kNormalPaddingWidth = 7; | 1011 constexpr int kNormalPaddingWidth = 7; |
| 1013 int arrow_pad = UseMd() ? kMdPaddingWidth : kNormalPaddingWidth; | 1012 int arrow_pad = UseMd() ? kMdPaddingWidth : kNormalPaddingWidth; |
| 1014 int padding = style_ == STYLE_NORMAL | 1013 int padding = style_ == STYLE_NORMAL |
| 1015 ? arrow_pad * 2 | 1014 ? arrow_pad * 2 |
| 1016 : kActionLeftPadding + kActionRightPadding; | 1015 : kActionLeftPadding + kActionRightPadding; |
| 1017 return ArrowSize().width() + padding; | 1016 return ArrowSize().width() + padding; |
| 1018 } | 1017 } |
| 1019 | 1018 |
| 1020 } // namespace views | 1019 } // namespace views |
| OLD | NEW |