yuv colorspace/range + prefs, ffmpeg colorrange probe, x11 direct force colormodel...
[goodguy/history.git] / cinelerra-5.1 / guicast / bcfilebox.C
index 207084d7415f054650989df444b4ba79905df8fe..7ca7e4ab8962428b933dbcee3b05ba9f84d3f9c2 100644 (file)
@@ -1,7 +1,7 @@
 
 /*
  * CINELERRA
- * Copyright (C) 1997-2011 Adam Williams <broadcast at earthling dot net>
+ * Copyright (C) 1997-2017 Adam Williams <broadcast at earthling dot net>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -683,9 +683,7 @@ int BC_FileBox::get_listbox_w()
 
 int BC_FileBox::get_listbox_h(int y)
 {
-       int result = get_h() -
-               y -
-               h_padding;
+       int result = get_h() - y - h_padding - 10;
        if(want_directory)
                result -= BC_WindowBase::get_resources()->dirbox_margin;
        else
@@ -883,25 +881,13 @@ int BC_FileBox::delete_tables()
 
 BC_Pixmap* BC_FileBox::get_icon(char *path, int is_dir)
 {
-       char *suffix = strrchr(path, '.');
+       if( is_dir ) return icons[ICON_FOLDER];
        int icon_type = ICON_UNKNOWN;
-
-       if(is_dir) return icons[ICON_FOLDER];
-
-       if(suffix)
-       {
-               suffix++;
-               if(*suffix != 0)
-               {
-                       for(int i = 0; i < TOTAL_SUFFIXES; i++)
-                       {
-                               if(!strcasecmp(suffix, BC_WindowBase::get_resources()->suffix_to_type[i].suffix))
-                               {
-                                       icon_type = BC_WindowBase::get_resources()->suffix_to_type[i].icon_type;
-                                       break;
-                               }
-                       }
-               }
+       char *suffix = strrchr(path, '.');
+       if( suffix && *++suffix ) {
+               suffix_to_type_t *stp = &BC_WindowBase::get_resources()->suffix_to_type[0];
+               while( stp->suffix && strcasecmp(stp->suffix, suffix) ) ++stp;
+               if( stp->icon_type ) icon_type = stp->icon_type;
        }
 
        return icons[icon_type];