Merged changes in the trunk up to revision 34193.
[blender.git] / source / blender / editors / interface / interface_templates.c
index 148834003590390f8234465eda22373010afd4b5..3f9c5cb6ca185a10adc7f9e41d5c65b5612a232a 100644 (file)
@@ -32,6 +32,7 @@
 #include "DNA_userdef_types.h"
 
 #include "BLI_string.h"
+#include "BLI_utildefines.h"
 
 #include "BKE_animsys.h"
 #include "BKE_colortools.h"
@@ -1383,7 +1384,7 @@ void uiTemplateHistogram(uiLayout *layout, PointerRNA *ptr, const char *propname
 
        hist = (Histogram *)cptr.data;
 
-       hist->height= (hist->height<=0)?100:hist->height;
+       hist->height= (hist->height<=20)?20:hist->height;
 
        bt= uiDefBut(block, HISTOGRAM, 0, "", rect.xmin, rect.ymin, rect.xmax-rect.xmin, hist->height, hist, 0, 0, 0, 0, "");
        uiButSetNFunc(bt, rna_update_cb, MEM_dupallocN(cb), NULL);
@@ -1420,7 +1421,7 @@ void uiTemplateWaveform(uiLayout *layout, PointerRNA *ptr, const char *propname)
        
        block= uiLayoutAbsoluteBlock(layout);
        
-       scopes->wavefrm_height= (scopes->wavefrm_height<=0)?100:scopes->wavefrm_height;
+       scopes->wavefrm_height= (scopes->wavefrm_height<=20)?20:scopes->wavefrm_height;
 
        bt= uiDefBut(block, WAVEFORM, 0, "", rect.xmin, rect.ymin, rect.xmax-rect.xmin, scopes->wavefrm_height, scopes, 0, 0, 0, 0, "");
        
@@ -1456,7 +1457,7 @@ void uiTemplateVectorscope(uiLayout *layout, PointerRNA *ptr, const char *propna
        
        block= uiLayoutAbsoluteBlock(layout);
 
-       scopes->vecscope_height= (scopes->vecscope_height<=0)?100:scopes->vecscope_height;
+       scopes->vecscope_height= (scopes->vecscope_height<=20)?20:scopes->vecscope_height;
        
        bt= uiDefBut(block, VECTORSCOPE, 0, "", rect.xmin, rect.ymin, rect.xmax-rect.xmin, scopes->vecscope_height, scopes, 0, 0, 0, 0, "");
        uiButSetNFunc(bt, rna_update_cb, MEM_dupallocN(cb), NULL);
@@ -1957,7 +1958,7 @@ void uiTemplateLayers(uiLayout *layout, PointerRNA *ptr, const char *propname,
 
 /************************* List Template **************************/
 
-static int list_item_icon_get(bContext *C, PointerRNA *itemptr, int rnaicon)
+static int list_item_icon_get(bContext *C, PointerRNA *itemptr, int rnaicon, int big)
 {
        ID *id= NULL;
        int icon;
@@ -1978,7 +1979,7 @@ static int list_item_icon_get(bContext *C, PointerRNA *itemptr, int rnaicon)
 
        /* get icon from ID */
        if(id) {
-               icon= ui_id_icon_get(C, id, 1);
+               icon= ui_id_icon_get(C, id, big);
 
                if(icon)
                        return icon;
@@ -2007,7 +2008,7 @@ static void list_item_row(bContext *C, uiLayout *layout, PointerRNA *ptr, Pointe
        sub= uiLayoutRow(overlap, 0);
 
        /* retrieve icon and name */
-       icon= list_item_icon_get(C, itemptr, rnaicon);
+       icon= list_item_icon_get(C, itemptr, rnaicon, 0);
        if(icon == ICON_NULL || icon == ICON_DOT)
                icon= 0;
 
@@ -2152,7 +2153,7 @@ void uiTemplateList(uiLayout *layout, bContext *C, PointerRNA *ptr, const char *
                                if(i == 9)
                                        row= uiLayoutRow(col, 0);
 
-                               icon= list_item_icon_get(C, &itemptr, rnaicon);
+                               icon= list_item_icon_get(C, &itemptr, rnaicon, 1);
                                but= uiDefIconButR(block, LISTROW, 0, icon, 0,0,UI_UNIT_X*10,UI_UNIT_Y, activeptr, activepropname, 0, 0, i, 0, 0, "");
                                uiButSetFlag(but, UI_BUT_NO_TOOLTIP);
                                
@@ -2176,7 +2177,7 @@ void uiTemplateList(uiLayout *layout, bContext *C, PointerRNA *ptr, const char *
                                if(found) {
                                        /* create button */
                                        name= RNA_struct_name_get_alloc(&itemptr, NULL, 0);
-                                       icon= list_item_icon_get(C, &itemptr, rnaicon);
+                                       icon= list_item_icon_get(C, &itemptr, rnaicon, 0);
                                        uiItemL(row, (name)? name: "", icon);
 
                                        if(name)