diff options
-rw-r--r-- | views/controls/button/native_button.cc | 14 | ||||
-rw-r--r-- | views/controls/button/native_button.h | 5 |
2 files changed, 5 insertions, 14 deletions
diff --git a/views/controls/button/native_button.cc b/views/controls/button/native_button.cc index 650bf0f..71a6b5a4 100644 --- a/views/controls/button/native_button.cc +++ b/views/controls/button/native_button.cc @@ -87,11 +87,14 @@ void NativeButton::SetLabel(const std::wstring& label) { void NativeButton::SetIsDefault(bool is_default) { if (is_default == is_default_) return; - if (is_default) + is_default_ = is_default; + if (is_default_) AddAccelerator(Accelerator(ui::VKEY_RETURN, false, false, false)); else RemoveAccelerator(Accelerator(ui::VKEY_RETURN, false, false, false)); - SetAppearsAsDefault(is_default); + if (native_wrapper_) + native_wrapper_->UpdateDefault(); + PreferredSizeChanged(); } void NativeButton::SetNeedElevation(bool need_elevation) { @@ -101,13 +104,6 @@ void NativeButton::SetNeedElevation(bool need_elevation) { PreferredSizeChanged(); } -void NativeButton::SetAppearsAsDefault(bool appears_as_default) { - is_default_ = appears_as_default; - if (native_wrapper_) - native_wrapper_->UpdateDefault(); - PreferredSizeChanged(); -} - void NativeButton::ButtonPressed() { RequestFocus(); diff --git a/views/controls/button/native_button.h b/views/controls/button/native_button.h index 86a935a..4090040 100644 --- a/views/controls/button/native_button.h +++ b/views/controls/button/native_button.h @@ -44,11 +44,6 @@ class NativeButton : public Button { void SetNeedElevation(bool need_elevation); bool need_elevation() const { return need_elevation_; } - // Sets whether or not the button appears as the default button. This does - // not make it behave as the default (i.e. no enter key accelerator is - // registered, use SetIsDefault for that). - void SetAppearsAsDefault(bool default_button); - void set_ignore_minimum_size(bool ignore_minimum_size) { ignore_minimum_size_ = ignore_minimum_size; } |