[Xfce4-commits] <midori:master> midori_browser_notebook_resize must consider n = 7

Christian Dywan noreply at xfce.org
Mon Mar 5 22:36:05 CET 2012


Updating branch refs/heads/master
         to bf07220bc34cdf1620ef1b7b5aa07cbd6645ccb5 (commit)
       from ba51341786ece2ede4be6e59362653c0ea8ff4ab (commit)

commit bf07220bc34cdf1620ef1b7b5aa07cbd6645ccb5
Author: Christian Dywan <christian at twotoasts.de>
Date:   Mon Mar 5 22:21:33 2012 +0100

    midori_browser_notebook_resize must consider n = 7

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

diff --git a/midori/midori-browser.c b/midori/midori-browser.c
index 3daa6bb..b4fbd3c 100644
--- a/midori/midori-browser.c
+++ b/midori/midori-browser.c
@@ -1521,20 +1521,18 @@ midori_browser_notebook_resize (MidoriBrowser* browser,
                                 GdkRectangle*  allocation)
 {
     gint new_size = 0;
-    gint n = gtk_notebook_get_n_pages (GTK_NOTEBOOK(browser->notebook));
+    gint n = MAX (1, 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;
 
-    g_return_if_fail (n > 0);
-
     if (allocation != NULL)
         notebook_size.width = allocation->width;
     else
         gtk_widget_get_allocation (browser->notebook, &notebook_size);
-    new_size = notebook_size.width / n - 7;
+    new_size = notebook_size.width / n;
 
     gtk_icon_size_lookup_for_settings (gtk_widget_get_settings (browser->notebook),
                                        GTK_ICON_SIZE_MENU, &icon_size, NULL);


More information about the Xfce4-commits mailing list