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



commit 2b037e430437539c58a7d7571e6e66a81b2ddf30
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 fb321e9b..4bc5b7eb 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]