summaryrefslogtreecommitdiff
path: root/gtk/gtkpathbar.c
diff options
context:
space:
mode:
authorCody Russell <bratsche@gnome.org>2007-06-04 18:17:14 +0000
committerCody Russell <bratsche@src.gnome.org>2007-06-04 18:17:14 +0000
commitea8f3758dd089a0015388abd8cebbad0d5f6f6df (patch)
tree05121e57a8adc5950706d313a3a2a3c57be4e12a /gtk/gtkpathbar.c
parent9a63d05e47e6bdb7341e9c671951b16fb47c8eb3 (diff)
downloadgtk+-ea8f3758dd089a0015388abd8cebbad0d5f6f6df.tar.gz
Check if down_button is NULL. This happens when the pathbar button for the
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
Diffstat (limited to 'gtk/gtkpathbar.c')
-rw-r--r--gtk/gtkpathbar.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gtk/gtkpathbar.c b/gtk/gtkpathbar.c
index fdda4f9308..e63eeac9b9 100644
--- a/gtk/gtkpathbar.c
+++ b/gtk/gtkpathbar.c
@@ -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