summaryrefslogtreecommitdiffstats
path: root/views/controls/button/native_button_gtk.cc
diff options
context:
space:
mode:
Diffstat (limited to 'views/controls/button/native_button_gtk.cc')
-rw-r--r--views/controls/button/native_button_gtk.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/views/controls/button/native_button_gtk.cc b/views/controls/button/native_button_gtk.cc
index fd58c42..17a25e2 100644
--- a/views/controls/button/native_button_gtk.cc
+++ b/views/controls/button/native_button_gtk.cc
@@ -55,7 +55,8 @@ void NativeButtonGtk::UpdateEnabled() {
void NativeButtonGtk::UpdateDefault() {
if (!native_view())
return;
- NOTIMPLEMENTED();
+ if (native_button_->is_default())
+ gtk_widget_grab_default(native_view());
}
View* NativeButtonGtk::GetView() {
@@ -96,6 +97,10 @@ void NativeButtonGtk::CreateNativeControl() {
GtkWidget* widget = gtk_button_new();
g_signal_connect(G_OBJECT(widget), "clicked",
G_CALLBACK(CallClicked), this);
+
+ // Any push button can become the default button.
+ GTK_WIDGET_SET_FLAGS(widget, GTK_CAN_DEFAULT);
+
NativeControlCreated(widget);
}