summaryrefslogtreecommitdiffstats
path: root/views/controls/button/native_button.cc
diff options
context:
space:
mode:
Diffstat (limited to 'views/controls/button/native_button.cc')
-rw-r--r--views/controls/button/native_button.cc14
1 files changed, 5 insertions, 9 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();