[gtk/default-handling: 14/18] widget: Remove special handling for has-default
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/default-handling: 14/18] widget: Remove special handling for has-default
- Date: Sun, 28 Apr 2019 19:32:59 +0000 (UTC)
commit 3d5bd8544bc8a7601830d018e9eb1f46decb76dd
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 | 13 +------------
1 file changed, 1 insertion(+), 12 deletions(-)
---
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index 6587a67e85..1d1055c2ab 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -9589,7 +9589,6 @@ gtk_widget_set_vexpand_set (GtkWidget *widget,
/*
* GtkBuildable implementation
*/
-static GQuark quark_builder_has_default = 0;
static GQuark quark_builder_has_focus = 0;
static GQuark quark_builder_atk_relations = 0;
static GQuark quark_builder_set_name = 0;
@@ -9622,7 +9621,6 @@ 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_has_focus = g_quark_from_static_string ("gtk-builder-has-focus");
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");
@@ -9701,10 +9699,7 @@ gtk_widget_buildable_set_buildable_property (GtkBuildable *buildable,
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 if (strcmp (name, "has-focus") == 0 && g_value_get_boolean (value))
+ if (strcmp (name, "has-focus") == 0 && g_value_get_boolean (value))
g_object_set_qdata (G_OBJECT (buildable), quark_builder_has_focus,
GINT_TO_POINTER (TRUE));
else
@@ -9749,12 +9744,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);
- }
-
if (g_object_get_qdata (G_OBJECT (buildable), quark_builder_has_focus))
{
gtk_widget_grab_focus (GTK_WIDGET (buildable));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]