summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntónio Fernandes <antoniojpfernandes@gmail.com>2022-01-01 21:42:20 +0000
committerAntónio Fernandes <antoniojpfernandes@gmail.com>2022-01-01 21:42:20 +0000
commit21f14abc1e25468e15aed799e7d5ca50fad11569 (patch)
treecbc7c49c39719fc71a9973fbd17c19dd5ec8f248
parent0579220546f7daff16a907f4c3256098c344e40c (diff)
downloadgtk+-wip/antoniof/dont-hard-code-properties-as-buildable.tar.gz
paned: Don't override properties when buildable wip/antoniof/dont-hard-code-properties-as-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.
-rw-r--r--gtk/gtkpaned.c8
1 files changed, 0 insertions, 8 deletions
diff --git a/gtk/gtkpaned.c b/gtk/gtkpaned.c
index 51a35d95fc..32c58ea5c5 100644
--- a/gtk/gtkpaned.c
+++ b/gtk/gtkpaned.c
@@ -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");