[gtk/wip/antoniof/dont-hard-code-properties-as-buildable] paned: Don't override properties when buildable




commit 21f14abc1e25468e15aed799e7d5ca50fad11569
Author: António Fernandes <antoniojpfernandes gmail com>
Date:   Sat Jan 1 21:42:20 2022 +0000

    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.

 gtk/gtkpaned.c | 8 --------
 1 file changed, 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");


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]