[gtk+/wip/csoriano/pathbar-prototype: 53/68] gtkhidingbox: use the parameters directly
- From: Carlos Soriano Sánchez <csoriano src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/csoriano/pathbar-prototype: 53/68] gtkhidingbox: use the parameters directly
- Date: Fri, 6 Nov 2015 18:45:46 +0000 (UTC)
commit c2570eed0c1b2157ce134da5b68ae391d1c4728e
Author: Carlos Soriano <csoriano gnome org>
Date: Wed Nov 4 16:13:26 2015 +0100
gtkhidingbox: use the parameters directly
gtk/gtkhidingbox.c | 16 +++++++---------
1 files changed, 7 insertions(+), 9 deletions(-)
---
diff --git a/gtk/gtkhidingbox.c b/gtk/gtkhidingbox.c
index 07dbf2d..de8cd85 100644
--- a/gtk/gtkhidingbox.c
+++ b/gtk/gtkhidingbox.c
@@ -313,13 +313,14 @@ gtk_hiding_box_get_preferred_width (GtkWidget *widget,
GtkHidingBoxPrivate *priv = gtk_hiding_box_get_instance_private (box);
gint cm;
gint cn;
- gint m;
- gint n;
GList *child;
gint n_visible_children;
gboolean have_min = FALSE;
- m = n = n_visible_children = 0;
+ *min = 0;
+ *nat = 0;
+
+ n_visible_children = 0;
for (child = priv->children; child != NULL; child = child->next)
{
if (!gtk_widget_is_visible (child->data))
@@ -330,19 +331,16 @@ gtk_hiding_box_get_preferred_width (GtkWidget *widget,
/* Minimum is a minimum of the first visible child */
if (!have_min)
{
- m = cm;
+ *min = cm;
have_min = TRUE;
}
/* Natural is a sum of all visible children */
- n += cn;
+ *nat += cn;
}
/* Natural must also include the spacing */
if (priv->spacing && n_visible_children > 1)
- n += priv->spacing * (n_visible_children - 1);
-
- *min = m;
- *nat = n;
+ *nat += priv->spacing * (n_visible_children - 1);
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]