Make vf_pop_menu_toggle_view_type_cb() independent of FILEVIEW_LIST/FILEVIEW_ICON...
authorLaurent Monin <geeqie@norz.org>
Sun, 11 May 2008 23:56:40 +0000 (23:56 +0000)
committerLaurent Monin <geeqie@norz.org>
Sun, 11 May 2008 23:56:40 +0000 (23:56 +0000)
src/view_file.c

index b04c5e5..f69ecd5 100644 (file)
@@ -428,7 +428,17 @@ void vf_pop_menu_toggle_view_type_cb(GtkWidget *widget, gpointer data)
 {
        ViewFile *vf = data;
        
-       if (vf->layout) layout_views_set(vf->layout, vf->layout->dir_view_type, !vf->layout->file_view_type);
+       if (!vf->layout) return;
+
+       switch(vf->layout->file_view_type)
+       {
+       case FILEVIEW_LIST:
+               layout_views_set(vf->layout, vf->layout->dir_view_type, FILEVIEW_ICON);
+               break;
+       case FILEVIEW_ICON:
+               layout_views_set(vf->layout, vf->layout->dir_view_type, FILEVIEW_LIST);
+               break;
+       }
 }