svn merge -r 21041:21301 https://svn.blender.org/svnroot/bf-blender/branches/blender2...
[blender.git] / source / blender / editors / space_file / file_draw.c
index 6ed8f87d987ef8855015b7454f1468ec868a7e69..02ee8f508c116563e834697cb19b6c90c6206f0a 100644 (file)
@@ -550,81 +550,4 @@ void file_draw_list(const bContext *C, ARegion *ar)
        }
 }
 
-static void file_draw_fsmenu_category(const bContext *C, ARegion *ar, FSMenuCategory category, const char* category_name, short *starty)
-{
-       struct FSMenu* fsmenu = fsmenu_get();
-       char bookmark[FILE_MAX];
-       int nentries = fsmenu_get_nentries(fsmenu, category);
-       
-       short sx, sy, xpos, ypos;
-       int bmwidth = ar->v2d.cur.xmax - ar->v2d.cur.xmin - 2*TILE_BORDER_X - ICON_DEFAULT_WIDTH - 4;
-       int fontsize = file_font_pointsize();
-       int cat_icon;
-       int i;
-
-       sx = ar->v2d.cur.xmin + TILE_BORDER_X;
-       sy = *starty;
-
-       UI_ThemeColor(TH_TEXT_HI);
-       file_draw_string(sx, sy, category_name, bmwidth, fontsize, FILE_SHORTEN_END);
-       
-       sy -= fontsize*2.0f;
-
-       switch(category) {
-               case FS_CATEGORY_SYSTEM:
-                       cat_icon = ICON_DISK_DRIVE; break;
-               case FS_CATEGORY_BOOKMARKS:
-                       cat_icon = ICON_BOOKMARKS; break;
-               case FS_CATEGORY_RECENT:
-                       cat_icon = ICON_FILE_FOLDER; break;
-       }
 
-       for (i=0; i< nentries && (sy > ar->v2d.cur.ymin) ;++i) {
-               char *fname = fsmenu_get_entry(fsmenu, category, i);
-
-               if (fname) {
-                       int sl;
-                       BLI_strncpy(bookmark, fname, FILE_MAX);
-               
-                       sl = strlen(bookmark)-1;
-                       if (sl > 1) {
-                       while (bookmark[sl] == '\\' || bookmark[sl] == '/') {
-                               bookmark[sl] = '\0';
-                               sl--;
-                       }
-                       }
-                       
-                       if (fsmenu_is_selected(fsmenu, category, i) ) {
-                               UI_ThemeColor(TH_HILITE);
-                               uiRoundBox(sx, sy - fontsize*2.0f, ar->v2d.cur.xmax - TILE_BORDER_X, sy, 4.0f);
-                               UI_ThemeColor(TH_TEXT);
-                       } else {
-                               UI_ThemeColor(TH_TEXT_HI);
-                       }
-
-                       xpos = sx;
-                       ypos = sy - (TILE_BORDER_Y * 0.5);
-                       
-                       file_draw_icon(xpos, ypos, cat_icon, ICON_DEFAULT_WIDTH, ICON_DEFAULT_WIDTH);
-                       xpos += ICON_DEFAULT_WIDTH + 4;
-                       file_draw_string(xpos, ypos, bookmark, bmwidth, fontsize, FILE_SHORTEN_FRONT);
-                       sy -= fontsize*2.0;
-                       fsmenu_set_pos(fsmenu, category, i, xpos, ypos);
-               }
-       }
-
-       *starty = sy;
-}
-
-void file_draw_fsmenu(const bContext *C, ARegion *ar)
-{
-       int linestep = file_font_pointsize()*2.0f;
-       short sy= ar->v2d.cur.ymax-2*TILE_BORDER_Y;
-
-       file_draw_fsmenu_category(C, ar, FS_CATEGORY_SYSTEM, "SYSTEM", &sy);
-       sy -= linestep;
-       file_draw_fsmenu_category(C, ar, FS_CATEGORY_BOOKMARKS, "BOOKMARKS", &sy);
-       sy -= linestep;
-       file_draw_fsmenu_category(C, ar, FS_CATEGORY_RECENT, "RECENT", &sy);
-       
-}