Compare commits

...

1 Commits

Author SHA1 Message Date
António Fernandes
21f14abc1e paned: Don't override properties when buildable
We set GtkPaned:{shrink,resize}-{start,end}-child when adding children
as buildable.

This overrides whatever value the UI definition had set for the properties.
Even if not  set explicitly, the properties have a default value anyway.

This fixes an issue I found while porting nautilus to GTK 4, as the 
start child was shrinkable even though :shrink-start-child was set
to FALSE in the .ui file.
2022-01-01 21:42:20 +00:00

View File

@@ -787,28 +787,20 @@ gtk_paned_buildable_add_child (GtkBuildable *buildable,
if (g_strcmp0 (type, "start") == 0)
{
gtk_paned_set_start_child (self, GTK_WIDGET (child));
gtk_paned_set_resize_start_child (self, FALSE);
gtk_paned_set_shrink_start_child (self, TRUE);
}
else if (g_strcmp0 (type, "end") == 0)
{
gtk_paned_set_end_child (self, GTK_WIDGET (child));
gtk_paned_set_resize_end_child (self, TRUE);
gtk_paned_set_shrink_end_child (self, TRUE);
}
else if (type == NULL && GTK_IS_WIDGET (child))
{
if (self->start_child == NULL)
{
gtk_paned_set_start_child (self, GTK_WIDGET (child));
gtk_paned_set_resize_start_child (self, FALSE);
gtk_paned_set_shrink_start_child (self, TRUE);
}
else if (self->end_child == NULL)
{
gtk_paned_set_end_child (self, GTK_WIDGET (child));
gtk_paned_set_resize_end_child (self, TRUE);
gtk_paned_set_shrink_end_child (self, TRUE);
}
else
g_warning ("GtkPaned only accepts two widgets as children");