Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/editors/interface')
-rw-r--r--source/blender/editors/interface/interface.c2
-rw-r--r--source/blender/editors/interface/interface_layout.c26
-rw-r--r--source/blender/editors/interface/interface_templates.c1
3 files changed, 17 insertions, 12 deletions
diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c
index 5ffc6440dc4..8278e7f6b36 100644
--- a/source/blender/editors/interface/interface.c
+++ b/source/blender/editors/interface/interface.c
@@ -2753,7 +2753,7 @@ void uiBlockFlipOrder(uiBlock *block)
uiBut *but, *next;
float centy, miny=10000, maxy= -10000;
- if(!(U.uiflag & USER_DIRECTIONALORDER))
+ if(U.uiflag & USER_MENUFIXEDORDER)
return;
for(but= block->buttons.first; but; but= but->next) {
diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c
index 81c49105870..555500004ea 100644
--- a/source/blender/editors/interface/interface_layout.c
+++ b/source/blender/editors/interface/interface_layout.c
@@ -601,7 +601,7 @@ void uiItemsEnumO(uiLayout *layout, char *opname, char *propname)
RNA_property_enum_items(&ptr, prop, &item, &totitem);
for(i=0; i<totitem; i++)
- uiItemEnumO(layout, NULL, 0, opname, propname, item[i].value);
+ uiItemEnumO(layout, (char*)item[i].name, item[i].icon, opname, propname, item[i].value);
}
}
@@ -716,6 +716,8 @@ static void ui_item_rna_size(uiLayout *layout, char *name, int icon, PropertyRNA
else if(ui_layout_vary_direction(layout) == UI_ITEM_VARY_X) {
if(type == PROP_BOOLEAN && strcmp(name, "") != 0)
w += UI_UNIT_X;
+ else if(type == PROP_ENUM)
+ w += UI_UNIT_X/2;
}
*r_w= w;
@@ -745,9 +747,11 @@ void uiItemFullR(uiLayout *layout, char *name, int icon, PointerRNA *ptr, Proper
if(!icon)
icon= RNA_property_ui_icon(prop);
- if(ELEM5(type, PROP_INT, PROP_FLOAT, PROP_STRING, PROP_ENUM, PROP_POINTER))
+ if(ELEM4(type, PROP_INT, PROP_FLOAT, PROP_STRING, PROP_POINTER))
name= ui_item_name_add_colon(name, namestr);
- if(type == PROP_BOOLEAN && len)
+ else if(type == PROP_BOOLEAN && len)
+ name= ui_item_name_add_colon(name, namestr);
+ else if(type == PROP_ENUM && index != RNA_ENUM_VALUE)
name= ui_item_name_add_colon(name, namestr);
if(layout->root->type == UI_LAYOUT_MENU) {
@@ -1453,9 +1457,9 @@ static void ui_litem_layout_free(uiLayout *litem)
totw -= minx;
toth -= miny;
- if(litem->w && totw > litem->w)
+ if(litem->w && totw > 0)
scalex= (float)litem->w/(float)totw;
- if(litem->h && toth > litem->h)
+ if(litem->h && toth > 0)
scaley= (float)litem->h/(float)toth;
x= litem->x;
@@ -1466,15 +1470,15 @@ static void ui_litem_layout_free(uiLayout *litem)
ui_item_size(item, &itemw, &itemh);
if(scalex != 1.0f) {
- newx= itemx*scalex;
- itemw= (itemx + itemw)*scalex - newx;
- itemx= newx;
+ newx= (itemx - minx)*scalex;
+ itemw= (itemx - minx + itemw)*scalex - newx;
+ itemx= minx + newx;
}
if(scaley != 1.0f) {
- newy= itemy*scaley;
- itemh= (itemy + itemh)*scaley - newy;
- itemy= newy;
+ newy= (itemy - miny)*scaley;
+ itemh= (itemy - miny + itemh)*scaley - newy;
+ itemy= miny + newy;
}
ui_item_position(item, x+itemx-minx, y+itemy-miny, itemw, itemh);
diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c
index a0ee264cf01..0bbe0850244 100644
--- a/source/blender/editors/interface/interface_templates.c
+++ b/source/blender/editors/interface/interface_templates.c
@@ -1490,3 +1490,4 @@ void uiTemplateLayers(uiLayout *layout, PointerRNA *ptr, char *propname)
}
}
}
+