UI: only show thumbnail size when its enabled
authorCampbell Barton <ideasman42@gmail.com>
Fri, 16 Oct 2015 07:51:33 +0000 (18:51 +1100)
committerCampbell Barton <ideasman42@gmail.com>
Fri, 16 Oct 2015 07:51:33 +0000 (18:51 +1100)
Also make enum identifiers less cryptic.

release/scripts/startup/bl_ui/space_filebrowser.py
source/blender/makesrna/intern/rna_space.c
source/blender/windowmanager/intern/wm_operators.c

index f6f86c0c7a77d228c531a11ecb63b833908b0bb7..0d30113e68a89e3f55aed810beb49ee603f8f3c6 100644 (file)
@@ -56,7 +56,8 @@ class FILEBROWSER_HT_header(Header):
 
             layout.prop(params, "display_type", expand=True, text="")
 
-            layout.prop(params, "thumbnail_size", text="")
+            if params.display_type == 'THUMBNAIL':
+                layout.prop(params, "thumbnail_size", text="")
 
             layout.prop(params, "sort_method", expand=True, text="")
 
index d73b2315434d14c7094836a9d635ee3a99704b32..5114037f8522e7ac13525391cdd3cd97570c67e6 100644 (file)
@@ -3735,9 +3735,9 @@ static void rna_def_fileselect_params(BlenderRNA *brna)
        PropertyRNA *prop;
        
        static EnumPropertyItem file_display_items[] = {
-               {FILE_SHORTDISPLAY, "FILE_SHORTDISPLAY", ICON_SHORTDISPLAY, "Short List", "Display files as short list"},
-               {FILE_LONGDISPLAY, "FILE_LONGDISPLAY", ICON_LONGDISPLAY, "Long List", "Display files as a detailed list"},
-               {FILE_IMGDISPLAY, "FILE_IMGDISPLAY", ICON_IMGDISPLAY, "Thumbnails", "Display files as thumbnails"},
+               {FILE_SHORTDISPLAY, "LIST_SHORT", ICON_SHORTDISPLAY, "Short List", "Display files as short list"},
+               {FILE_LONGDISPLAY,  "LIST_LONG", ICON_LONGDISPLAY, "Long List", "Display files as a detailed list"},
+               {FILE_IMGDISPLAY, "THUMBNAIL", ICON_IMGDISPLAY, "Thumbnails", "Display files as thumbnails"},
                {0, NULL, 0, NULL, NULL}
        };
 
index 5c2e1f859c8d14ab3bacb1c08efb11f8b76a2e66..2e039d815f6472126a08508a25eaed4be931806e 100644 (file)
@@ -1215,10 +1215,10 @@ void WM_operator_properties_filesel(wmOperatorType *ot, int filter, short type,
        PropertyRNA *prop;
 
        static EnumPropertyItem file_display_items[] = {
-               {FILE_DEFAULTDISPLAY, "FILE_DEFAULTDISPLAY", 0, "Default", "Automatically determine display type for files"},
-               {FILE_SHORTDISPLAY, "FILE_SHORTDISPLAY", ICON_SHORTDISPLAY, "Short List", "Display files as short list"},
-               {FILE_LONGDISPLAY, "FILE_LONGDISPLAY", ICON_LONGDISPLAY, "Long List", "Display files as a detailed list"},
-               {FILE_IMGDISPLAY, "FILE_IMGDISPLAY", ICON_IMGDISPLAY, "Thumbnails", "Display files as thumbnails"},
+               {FILE_DEFAULTDISPLAY, "DEFAULT", 0, "Default", "Automatically determine display type for files"},
+               {FILE_SHORTDISPLAY, "LIST_SHORT", ICON_SHORTDISPLAY, "Short List", "Display files as short list"},
+               {FILE_LONGDISPLAY, "LIST_LONG", ICON_LONGDISPLAY, "Long List", "Display files as a detailed list"},
+               {FILE_IMGDISPLAY, "THUMBNAIL", ICON_IMGDISPLAY, "Thumbnails", "Display files as thumbnails"},
                {0, NULL, 0, NULL, NULL}
        };