[gtk/matthiasc/for-master: 5/5] constraintlayout: Make sure guides get their constraints




commit 2dbaca2464f9baf402a9ac165b78c19e2015dad9
Author: Matthias Clasen <mclasen redhat com>
Date:   Fri Oct 30 14:59:08 2020 -0400

    constraintlayout: Make sure guides get their constraints
    
    When using GtkBuilder to create constraints and guides,
    the layout manager is already rooted when the guides get
    created, and we were forgetting to create the guides
    constraints in this case. Fix it by adding a call to
    gtk_constraint_guide_update().
    
    This was showing up in the new builder-based constraints
    demo as the guide not having the expected effect.

 gtk/gtkconstraintlayout.c | 3 +++
 1 file changed, 3 insertions(+)
---
diff --git a/gtk/gtkconstraintlayout.c b/gtk/gtkconstraintlayout.c
index 86ae56ce06..e5d6037962 100644
--- a/gtk/gtkconstraintlayout.c
+++ b/gtk/gtkconstraintlayout.c
@@ -1867,7 +1867,10 @@ gtk_constraint_layout_add_guide (GtkConstraintLayout *layout,
   if (layout->guides_observer)
     g_list_store_append (layout->guides_observer, guide);
 
+  gtk_constraint_guide_update (guide);
+
   gtk_layout_manager_layout_changed (GTK_LAYOUT_MANAGER (layout));
+
 }
 
 /**


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