]> Pileus Git - ~andy/gtk/commitdiff
Check if down_button is NULL. This happens when the pathbar button for the
authorCody Russell <bratsche@gnome.org>
Mon, 4 Jun 2007 18:17:14 +0000 (18:17 +0000)
committerCody Russell <bratsche@src.gnome.org>
Mon, 4 Jun 2007 18:17:14 +0000 (18:17 +0000)
2007-06-04  Cody Russell  <bratsche@gnome.org>

        * gtk/gtkpathbar.c (gtk_path_bar_scroll_down): Check
        if down_button is NULL.  This happens when the pathbar button
        for the current directory is too large to fit in the
        space, e.g. on Windows for directories named something like
        "My Documents and Settings".

svn path=/trunk/; revision=18030

ChangeLog
gtk/gtkpathbar.c

index 61e9e487a30ce500f93586d4a4b8274a09c8403a..984c3ca022d8ff93a114511006276d487105e6cf 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2007-06-04  Cody Russell  <bratsche@gnome.org>
+
+       * gtk/gtkpathbar.c (gtk_path_bar_scroll_down): Check
+       if down_button is NULL.  This happens when the pathbar button
+       for the current directory is too large to fit in the
+       space, e.g. on Windows for directories named something like
+       "My Documents and Settings".
+
 2007-06-04  Matthias Clasen  <mclasen@redhat.com>
 
        * configure.in: Bump version
index fdda4f9308f8fcc7dcb4d2e804bc89a793807026..e63eeac9b97b83f89c2219a20f1ad58d2675cc7a 100644 (file)
@@ -722,7 +722,10 @@ gtk_path_bar_scroll_down (GtkWidget *button, GtkPathBar *path_bar)
        }
     }
 
-  space_needed = BUTTON_DATA (down_button->data)->button->allocation.width + path_bar->spacing;
+  /* We check if down_button might be NULL in cases where the pathbar's horizontal size is smaller
+   * than the button and it doesn't get displayed. e.g., on Windows it might be "My Documents and Settings"
+   */
+  space_needed = down_button ? BUTTON_DATA (down_button->data)->button->allocation.width : 0 + path_bar->spacing;
   if (direction == GTK_TEXT_DIR_RTL)
     space_available = path_bar->down_slider_button->allocation.x - GTK_WIDGET (path_bar)->allocation.x;
   else