[libhandy/wip/exalm/leaflet-transltions: 30/37] stackable-box: Reduce amount of set_child_visible() calls



commit f33e5e8b04644747f79f64e7aa88a04a947d0573
Author: Alexander Mikhaylenko <alexm gnome org>
Date:   Fri May 29 00:34:59 2020 +0500

    stackable-box: Reduce amount of set_child_visible() calls
    
    Only call it once for each child per allocation, this will prevent spurious
    signal emissions later.
    
    Signed-off-by: Alexander Mikhaylenko <alexm gnome org>

 src/hdy-stackable-box.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/src/hdy-stackable-box.c b/src/hdy-stackable-box.c
index 3dad9419..1f862b49 100644
--- a/src/hdy-stackable-box.c
+++ b/src/hdy-stackable-box.c
@@ -1485,7 +1485,7 @@ hdy_stackable_box_size_allocate_folded (HdyStackableBox *self,
         child_info->widget == self->last_visible_child->widget)
       continue;
 
-    gtk_widget_set_child_visible (child_info->widget, FALSE);
+    child_info->visible = FALSE;
   }
 
   if (visible_child->widget == NULL)
@@ -1493,12 +1493,12 @@ hdy_stackable_box_size_allocate_folded (HdyStackableBox *self,
 
   /* FIXME is this needed? */
   if (!gtk_widget_get_visible (visible_child->widget)) {
-    gtk_widget_set_child_visible (visible_child->widget, FALSE);
+    visible_child->visible = FALSE;
 
     return;
   }
 
-  gtk_widget_set_child_visible (visible_child->widget, TRUE);
+  visible_child->visible = TRUE;
 
   mode_transition_type = self->transition_type;
 


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