[gtk/wip/matthiasc/popup4: 93/94] widget: Drop gtk_widget_grab_default
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/matthiasc/popup4: 93/94] widget: Drop gtk_widget_grab_default
- Date: Sat, 27 Apr 2019 04:49:13 +0000 (UTC)
commit bb29349e963d1f0a873a51842a9417d690afa015
Author: Matthias Clasen <mclasen redhat com>
Date: Sat Apr 27 03:57:13 2019 +0000
widget: Drop gtk_widget_grab_default
The default widget is mostly a dialog concept,
and does not really need this generic api. If
we need to mark a widget as default, use
gtk_window_set_default().
docs/reference/gtk/gtk4-sections.txt | 1 -
gtk/gtkwidget.c | 29 +----------------------------
gtk/gtkwidget.h | 2 --
3 files changed, 1 insertion(+), 31 deletions(-)
---
diff --git a/docs/reference/gtk/gtk4-sections.txt b/docs/reference/gtk/gtk4-sections.txt
index df2e305f71..156abe8739 100644
--- a/docs/reference/gtk/gtk4-sections.txt
+++ b/docs/reference/gtk/gtk4-sections.txt
@@ -4433,7 +4433,6 @@ gtk_widget_event
gtk_widget_activate
gtk_widget_is_focus
gtk_widget_grab_focus
-gtk_widget_grab_default
gtk_widget_set_name
gtk_widget_get_name
gtk_widget_set_sensitive
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index 9f5af4b5c1..8e793981df 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -1053,7 +1053,7 @@ gtk_widget_class_init (GtkWidgetClass *klass)
P_("Has default"),
P_("Whether the widget is the default widget"),
FALSE,
- GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
+ GTK_PARAM_READABLE|G_PARAM_EXPLICIT_NOTIFY);
widget_props[PROP_RECEIVES_DEFAULT] =
g_param_spec_boolean ("receives-default",
@@ -2201,10 +2201,6 @@ gtk_widget_set_property (GObject *object,
case PROP_CAN_DEFAULT:
gtk_widget_set_can_default (widget, g_value_get_boolean (value));
break;
- case PROP_HAS_DEFAULT:
- if (g_value_get_boolean (value))
- gtk_widget_grab_default (widget);
- break;
case PROP_RECEIVES_DEFAULT:
gtk_widget_set_receives_default (widget, g_value_get_boolean (value));
break;
@@ -5888,29 +5884,6 @@ _gtk_widget_set_has_default (GtkWidget *widget,
gtk_style_context_remove_class (context, GTK_STYLE_CLASS_DEFAULT);
}
-/**
- * gtk_widget_grab_default:
- * @widget: a #GtkWidget
- *
- * Causes @widget to become the default widget. @widget must be able to be
- * a default widget; typically you would ensure this yourself
- * by calling gtk_widget_set_can_default() with a %TRUE value.
- * The default widget is activated when
- * the user presses Enter in a window. Default widgets must be
- * activatable, that is, gtk_widget_activate() should affect them. Note
- * that #GtkEntry widgets require the “activates-default” property
- * set to %TRUE before they activate the default widget when Enter
- * is pressed and the #GtkEntry is focused.
- **/
-void
-gtk_widget_grab_default (GtkWidget *widget)
-{
- g_return_if_fail (GTK_IS_WIDGET (widget));
- g_return_if_fail (gtk_widget_get_can_default (widget));
-
- gtk_root_set_default (gtk_widget_get_root (widget), widget);
-}
-
/**
* gtk_widget_set_receives_default:
* @widget: a #GtkWidget
diff --git a/gtk/gtkwidget.h b/gtk/gtkwidget.h
index f737af6ccd..b3dcf30267 100644
--- a/gtk/gtkwidget.h
+++ b/gtk/gtkwidget.h
@@ -482,8 +482,6 @@ GDK_AVAILABLE_IN_ALL
gboolean gtk_widget_get_can_default (GtkWidget *widget);
GDK_AVAILABLE_IN_ALL
gboolean gtk_widget_has_default (GtkWidget *widget);
-GDK_AVAILABLE_IN_ALL
-void gtk_widget_grab_default (GtkWidget *widget);
GDK_AVAILABLE_IN_ALL
void gtk_widget_set_receives_default (GtkWidget *widget,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]