[gtk/default-handling: 22/25] widget: Remove special handling for has-default
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/default-handling: 22/25] widget: Remove special handling for has-default
- Date: Sun, 28 Apr 2019 23:31:51 +0000 (UTC)
commit 6d734431311f0f3f6ae3b25cfa39da0aa3db3ed5
Author: Matthias Clasen <mclasen redhat com>
Date: Sat Apr 27 03:49:52 2019 +0000
widget: Remove special handling for has-default
We used to handle has-default specially in ui
files. It was awkward, so stop doing that. If you
need to influence the default widget in a window,
you can just set the default-widget property.
gtk/gtkwidget.c | 26 --------------------------
1 file changed, 26 deletions(-)
---
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index 0ffff50e36..bbacdfdd34 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -676,10 +676,6 @@ static const gchar * gtk_widget_buildable_get_name (GtkBuildable
static GObject * gtk_widget_buildable_get_internal_child (GtkBuildable *buildable,
GtkBuilder *builder,
const gchar *childname);
-static void gtk_widget_buildable_set_buildable_property (GtkBuildable *buildable,
- GtkBuilder *builder,
- const gchar *name,
- const GValue *value);
static gboolean gtk_widget_buildable_custom_tag_start (GtkBuildable *buildable,
GtkBuilder *builder,
GObject *child,
@@ -9590,7 +9586,6 @@ gtk_widget_set_vexpand_set (GtkWidget *widget,
/*
* GtkBuildable implementation
*/
-static GQuark quark_builder_has_default = 0;
static GQuark quark_builder_atk_relations = 0;
static GQuark quark_builder_set_name = 0;
@@ -9622,14 +9617,12 @@ gtk_widget_buildable_add_child (GtkBuildable *buildable,
static void
gtk_widget_buildable_interface_init (GtkBuildableIface *iface)
{
- quark_builder_has_default = g_quark_from_static_string ("gtk-builder-has-default");
quark_builder_atk_relations = g_quark_from_static_string ("gtk-builder-atk-relations");
quark_builder_set_name = g_quark_from_static_string ("gtk-builder-set-name");
iface->set_name = gtk_widget_buildable_set_name;
iface->get_name = gtk_widget_buildable_get_name;
iface->get_internal_child = gtk_widget_buildable_get_internal_child;
- iface->set_buildable_property = gtk_widget_buildable_set_buildable_property;
iface->parser_finished = gtk_widget_buildable_parser_finished;
iface->custom_tag_start = gtk_widget_buildable_custom_tag_start;
iface->custom_tag_end = gtk_widget_buildable_custom_tag_end;
@@ -9694,19 +9687,6 @@ gtk_widget_buildable_get_internal_child (GtkBuildable *buildable,
return NULL;
}
-static void
-gtk_widget_buildable_set_buildable_property (GtkBuildable *buildable,
- GtkBuilder *builder,
- const gchar *name,
- const GValue *value)
-{
- if (strcmp (name, "has-default") == 0 && g_value_get_boolean (value))
- g_object_set_qdata (G_OBJECT (buildable), quark_builder_has_default,
- GINT_TO_POINTER (TRUE));
- else
- g_object_set_property (G_OBJECT (buildable), name, value);
-}
-
typedef struct
{
gchar *action_name;
@@ -9745,12 +9725,6 @@ gtk_widget_buildable_parser_finished (GtkBuildable *buildable,
{
GSList *atk_relations;
- if (g_object_get_qdata (G_OBJECT (buildable), quark_builder_has_default))
- {
- gtk_widget_grab_default (GTK_WIDGET (buildable));
- g_object_steal_qdata (G_OBJECT (buildable), quark_builder_has_default);
- }
-
atk_relations = g_object_get_qdata (G_OBJECT (buildable),
quark_builder_atk_relations);
if (atk_relations)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]