Undo revision 23130 which was a merge with 2.5, a messy one because I did something...
[blender.git] / source / blender / editors / interface / interface.c
index 3c6e129..92a3a4c 100644 (file)
@@ -225,7 +225,6 @@ static void ui_text_bounds_block(uiBlock *block, float offset)
        uiStyle *style= U.uistyles.first;       // XXX pass on as arg
        uiBut *bt;
        int i = 0, j, x1addval= offset, nextcol;
-       int lastcol= 0, col= 0;
        
        uiStyleFontSet(&style->widget);
        
@@ -238,26 +237,18 @@ static void ui_text_bounds_block(uiBlock *block, float offset)
 
                        if(j > i) i = j;
                }
-
-               if(bt->next && bt->x1 < bt->next->x1)
-                       lastcol++;
        }
 
        /* cope with multi collumns */
        bt= block->buttons.first;
        while(bt) {
-               if(bt->next && bt->x1 < bt->next->x1) {
+               if(bt->next && bt->x1 < bt->next->x1)
                        nextcol= 1;
-                       col++;
-               }
                else nextcol= 0;
                
                bt->x1 = x1addval;
                bt->x2 = bt->x1 + i + block->bounds;
                
-               if(col == lastcol)
-                       bt->x2= MAX2(bt->x2, offset + block->minbounds);
-
                ui_check_but(bt);       // clips text again
                
                if(nextcol)
@@ -290,7 +281,7 @@ void ui_bounds_block(uiBlock *block)
        
                        if(bt->x2 > block->maxx) block->maxx= bt->x2;
                        if(bt->y2 > block->maxy) block->maxy= bt->y2;
-
+                       
                        bt= bt->next;
                }
                
@@ -300,8 +291,6 @@ void ui_bounds_block(uiBlock *block)
                block->maxy += block->bounds;
        }
 
-       block->maxx= block->minx + MAX2(block->maxx - block->minx, block->minbounds);
-
        /* hardcoded exception... but that one is annoying with larger safety */ 
        bt= block->buttons.first;
        if(bt && strncmp(bt->str, "ERROR", 5)==0) xof= 10;
@@ -1089,7 +1078,7 @@ void ui_get_but_vectorf(uiBut *but, float *vec)
                vec[0]= vec[1]= vec[2]= 0.0f;
 
                if(RNA_property_type(prop) == PROP_FLOAT) {
-                       tot= RNA_property_array_length(&but->rnapoin, prop);
+                       tot= RNA_property_array_length(prop);
                        tot= MIN2(tot, 3);
 
                        for(a=0; a<tot; a++)
@@ -1123,7 +1112,7 @@ void ui_set_but_vectorf(uiBut *but, float *vec)
                prop= but->rnaprop;
 
                if(RNA_property_type(prop) == PROP_FLOAT) {
-                       tot= RNA_property_array_length(&but->rnapoin, prop);
+                       tot= RNA_property_array_length(prop);
                        tot= MIN2(tot, 3);
 
                        for(a=0; a<tot; a++)
@@ -1181,19 +1170,19 @@ double ui_get_but_val(uiBut *but)
 
                switch(RNA_property_type(prop)) {
                        case PROP_BOOLEAN:
-                               if(RNA_property_array_length(&but->rnapoin, prop))
+                               if(RNA_property_array_length(prop))
                                        value= RNA_property_boolean_get_index(&but->rnapoin, prop, but->rnaindex);
                                else
                                        value= RNA_property_boolean_get(&but->rnapoin, prop);
                                break;
                        case PROP_INT:
-                               if(RNA_property_array_length(&but->rnapoin, prop))
+                               if(RNA_property_array_length(prop))
                                        value= RNA_property_int_get_index(&but->rnapoin, prop, but->rnaindex);
                                else
                                        value= RNA_property_int_get(&but->rnapoin, prop);
                                break;
                        case PROP_FLOAT:
-                               if(RNA_property_array_length(&but->rnapoin, prop))
+                               if(RNA_property_array_length(prop))
                                        value= RNA_property_float_get_index(&but->rnapoin, prop, but->rnaindex);
                                else
                                        value= RNA_property_float_get(&but->rnapoin, prop);
@@ -1245,19 +1234,19 @@ void ui_set_but_val(uiBut *but, double value)
                if(RNA_property_editable(&but->rnapoin, prop)) {
                        switch(RNA_property_type(prop)) {
                                case PROP_BOOLEAN:
-                                       if(RNA_property_array_length(&but->rnapoin, prop))
+                                       if(RNA_property_array_length(prop))
                                                RNA_property_boolean_set_index(&but->rnapoin, prop, but->rnaindex, value);
                                        else
                                                RNA_property_boolean_set(&but->rnapoin, prop, value);
                                        break;
                                case PROP_INT:
-                                       if(RNA_property_array_length(&but->rnapoin, prop))
+                                       if(RNA_property_array_length(prop))
                                                RNA_property_int_set_index(&but->rnapoin, prop, but->rnaindex, value);
                                        else
                                                RNA_property_int_set(&but->rnapoin, prop, value);
                                        break;
                                case PROP_FLOAT:
-                                       if(RNA_property_array_length(&but->rnapoin, prop))
+                                       if(RNA_property_array_length(prop))
                                                RNA_property_float_set_index(&but->rnapoin, prop, but->rnaindex, value);
                                        else
                                                RNA_property_float_set(&but->rnapoin, prop, value);
@@ -2297,12 +2286,8 @@ uiBut *ui_def_but_rna(uiBlock *block, int type, int retval, char *str, short x1,
                                dynstr= BLI_dynstr_new();
                                BLI_dynstr_appendf(dynstr, "%s%%t", RNA_property_ui_name(prop));
                                for(i=0; i<totitem; i++) {
-                                       if(!item[i].identifier[0]) {
-                                               if(item[i].name)
-                                                       BLI_dynstr_appendf(dynstr, "|%s%%l", item[i].name);
-                                               else
-                                                       BLI_dynstr_append(dynstr, "|%l");
-                                       }
+                                       if(!item[i].identifier[0])
+                                               BLI_dynstr_append(dynstr, "|%l");
                                        else if(item[i].icon)
                                                BLI_dynstr_appendf(dynstr, "|%s %%i%d %%x%d", item[i].name, item[i].icon, item[i].value);
                                        else
@@ -2414,7 +2399,7 @@ uiBut *ui_def_but_rna(uiBlock *block, int type, int retval, char *str, short x1,
                but->rnapoin= *ptr;
                but->rnaprop= prop;
 
-               if(RNA_property_array_length(&but->rnapoin, but->rnaprop))
+               if(RNA_property_array_length(but->rnaprop))
                        but->rnaindex= index;
                else
                        but->rnaindex= 0;
@@ -2854,8 +2839,6 @@ void uiBlockFlipOrder(uiBlock *block)
 
        if(U.uiflag & USER_MENUFIXEDORDER)
                return;
-       else if(block->flag & UI_BLOCK_NO_FLIP)
-               return;
        
        for(but= block->buttons.first; but; but= but->next) {
                if(but->flag & UI_BUT_ALIGN) return;