[Xfce4-commits] <midori:master> Iterate children in notebook_alloc_timeout

Christian Dywan noreply at xfce.org
Sat Dec 10 19:54:03 CET 2011


Updating branch refs/heads/master
         to 9ba0c2806ed9a7d33fe5c29be95b6023ada3828c (commit)
       from 1845d0bcbc53fed0d260f52b9255b89ce437700a (commit)

commit 9ba0c2806ed9a7d33fe5c29be95b6023ada3828c
Author: Christian Dywan <christian at twotoasts.de>
Date:   Sat Dec 10 19:30:48 2011 +0100

    Iterate children in notebook_alloc_timeout

 midori/midori-browser.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/midori/midori-browser.c b/midori/midori-browser.c
index 76283b4..a553850 100644
--- a/midori/midori-browser.c
+++ b/midori/midori-browser.c
@@ -1487,13 +1487,13 @@ midori_browser_tab_destroy_cb (GtkWidget*     widget,
 static gboolean
 midori_browser_notebook_alloc_timeout (MidoriBrowser* browser)
 {
-    guint i;
     gint new_size = 0;
     gint n = gtk_notebook_get_n_pages (GTK_NOTEBOOK(browser->notebook));
     const gint max_size = 150;
     gint min_size;
     gint icon_size = 16;
     GtkAllocation notebook_size;
+    GList* children;
 
     gtk_widget_get_allocation (browser->notebook, &notebook_size);
     if (n > 0) new_size = notebook_size.width / n - 7;
@@ -1506,11 +1506,11 @@ midori_browser_notebook_alloc_timeout (MidoriBrowser* browser)
     if (new_size < min_size) new_size = min_size;
     if (new_size > max_size) new_size = max_size;
 
-    for (i = 0; i < n; i++)
+    children = gtk_container_get_children (GTK_CONTAINER (browser->notebook));
+    for (; children; children = g_list_next (children))
     {
-        GtkWidget* view;
+        GtkWidget* view = children->data;
         GtkWidget* label;
-        view = gtk_notebook_get_nth_page (GTK_NOTEBOOK(browser->notebook), i);
         label = gtk_notebook_get_tab_label (GTK_NOTEBOOK(browser->notebook), view);
         /* Don't resize empty bin, which is used for thumbnail tabs */
         if (GTK_IS_BIN (label) && gtk_bin_get_child (GTK_BIN (label))


More information about the Xfce4-commits mailing list