forked from AuroraMiddleware/gtk
widget: Remove special handling of has-focus
We used to handle has-focus in ui files specially. It was awkward, so stop doing that. If you need to influence the initial focus of a window, you can just set the focus-widget property.
This commit is contained in:
parent
c98313016e
commit
c92938b378
@ -9590,7 +9590,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;
|
||||
|
||||
@ -9623,7 +9622,6 @@ 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");
|
||||
|
||||
@ -9704,9 +9702,6 @@ gtk_widget_buildable_set_buildable_property (GtkBuildable *buildable,
|
||||
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))
|
||||
g_object_set_qdata (G_OBJECT (buildable), quark_builder_has_focus,
|
||||
GINT_TO_POINTER (TRUE));
|
||||
else
|
||||
g_object_set_property (G_OBJECT (buildable), name, value);
|
||||
}
|
||||
@ -9755,12 +9750,6 @@ gtk_widget_buildable_parser_finished (GtkBuildable *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));
|
||||
g_object_steal_qdata (G_OBJECT (buildable), quark_builder_has_focus);
|
||||
}
|
||||
|
||||
atk_relations = g_object_get_qdata (G_OBJECT (buildable),
|
||||
quark_builder_atk_relations);
|
||||
if (atk_relations)
|
||||
|
Loading…
Reference in New Issue
Block a user