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:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2009-08-19 04:55:30 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2009-08-19 04:55:30 +0400
commit184ac26dd0187d70985cdc49ae527a1900fce840 (patch)
tree7b946acb11e0a430b61e2f608e0308a1b18439d7 /source/blender/editors/interface
parente21c1dde810b3447eaa1f6a667ae027978b18d9b (diff)
2.5: Headers
* Fix header menu spacing bug, and make it consistent for all headers. * For consistency, always put menus first in the header, then any enums to switch the type of data displayed. * Node editor header ported to python layout. Still quite a few operators missing to make the menus complete. * RNA wrapped node editor, and added use_nodes property to material and scene.
Diffstat (limited to 'source/blender/editors/interface')
-rw-r--r--source/blender/editors/interface/interface_layout.c24
-rw-r--r--source/blender/editors/interface/interface_widgets.c2
2 files changed, 13 insertions, 13 deletions
diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c
index dee486b6b93..fc4f7da56d2 100644
--- a/source/blender/editors/interface/interface_layout.c
+++ b/source/blender/editors/interface/interface_layout.c
@@ -215,16 +215,16 @@ static int ui_layout_vary_direction(uiLayout *layout)
}
/* estimated size of text + icon */
-static int ui_text_icon_width(uiLayout *layout, char *name, int icon)
+static int ui_text_icon_width(uiLayout *layout, char *name, int icon, int compact)
{
int variable = ui_layout_vary_direction(layout) == UI_ITEM_VARY_X;
if(icon && !name[0])
return UI_UNIT_X; /* icon only */
else if(icon)
- return (variable)? UI_GetStringWidth(name) + 10 + UI_UNIT_X: 10*UI_UNIT_X; /* icon + text */
+ return (variable)? UI_GetStringWidth(name) + (compact? 5: 10) + UI_UNIT_X: 10*UI_UNIT_X; /* icon + text */
else
- return (variable)? UI_GetStringWidth(name) + 10 + UI_UNIT_X: 10*UI_UNIT_X; /* text only */
+ return (variable)? UI_GetStringWidth(name) + (compact? 5: 10) + UI_UNIT_X: 10*UI_UNIT_X; /* text only */
}
static void ui_item_size(uiItem *item, int *r_w, int *r_h)
@@ -433,7 +433,7 @@ static void ui_item_enum_row(uiLayout *layout, uiBlock *block, PointerRNA *ptr,
name= (!uiname || uiname[0])? (char*)item[a].name: "";
icon= item[a].icon;
value= item[a].value;
- itemw= ui_text_icon_width(block->curlayout, name, icon);
+ itemw= ui_text_icon_width(block->curlayout, name, icon, 0);
if(icon && strcmp(name, "") != 0)
uiDefIconTextButR(block, ROW, 0, icon, name, 0, 0, itemw, h, ptr, identifier, -1, 0, value, -1, -1, NULL);
@@ -526,7 +526,7 @@ static void ui_item_disabled(uiLayout *layout, char *name)
if(!name)
name= "";
- w= ui_text_icon_width(layout, name, 0);
+ w= ui_text_icon_width(layout, name, 0, 0);
but= uiDefBut(block, LABEL, 0, (char*)name, 0, 0, w, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 0, "");
but->flag |= UI_BUT_DISABLED;
@@ -555,7 +555,7 @@ void uiItemFullO(uiLayout *layout, char *name, int icon, char *idname, IDPropert
/* create button */
uiBlockSetCurLayout(block, layout);
- w= ui_text_icon_width(layout, name, icon);
+ w= ui_text_icon_width(layout, name, icon, 0);
if(icon && strcmp(name, "") != 0)
but= uiDefIconTextButO(block, BUT, ot->idname, context, icon, (char*)name, 0, 0, w, UI_UNIT_Y, NULL);
@@ -746,7 +746,7 @@ static void ui_item_rna_size(uiLayout *layout, char *name, int icon, PropertyRNA
else if(type == PROP_BOOLEAN && !name[0])
icon= ICON_DOT;
- w= ui_text_icon_width(layout, name, icon);
+ w= ui_text_icon_width(layout, name, icon, 0);
h= UI_UNIT_Y;
/* increase height for arrays */
@@ -1112,7 +1112,7 @@ static void ui_item_menu(uiLayout *layout, char *name, int icon, uiMenuCreateFun
if(layout->root->type == UI_LAYOUT_MENU && !icon)
icon= ICON_BLANK1;
- w= ui_text_icon_width(layout, name, icon);
+ w= ui_text_icon_width(layout, name, icon, 1);
h= UI_UNIT_Y;
if(layout->root->type == UI_LAYOUT_HEADER) /* ugly .. */
@@ -1170,7 +1170,7 @@ void uiItemL(uiLayout *layout, char *name, int icon)
if(layout->root->type == UI_LAYOUT_MENU && !icon)
icon= ICON_BLANK1;
- w= ui_text_icon_width(layout, name, icon);
+ w= ui_text_icon_width(layout, name, icon, 0);
if(icon && strcmp(name, "") != 0)
but= uiDefIconTextBut(block, LABEL, 0, icon, (char*)name, 0, 0, w, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 0, "");
@@ -1195,7 +1195,7 @@ void uiItemV(uiLayout *layout, char *name, int icon, int argval)
if(layout->root->type == UI_LAYOUT_MENU && !icon)
icon= ICON_BLANK1;
- w= ui_text_icon_width(layout, name, icon);
+ w= ui_text_icon_width(layout, name, icon, 0);
if(icon && strcmp(name, "") != 0)
uiDefIconTextButF(block, BUTM, 0, icon, (char*)name, 0, 0, w, UI_UNIT_Y, retvalue, 0.0, 0.0, 0, argval, "");
@@ -1215,12 +1215,12 @@ void uiItemS(uiLayout *layout)
}
/* level items */
-void uiItemMenuF(uiLayout *layout, char *name, int icon, uiMenuCreateFunc func)
+void uiItemMenuF(uiLayout *layout, char *name, int icon, uiMenuCreateFunc func, void *arg)
{
if(!func)
return;
- ui_item_menu(layout, name, icon, func, NULL, NULL);
+ ui_item_menu(layout, name, icon, func, arg, NULL);
}
typedef struct MenuItemLevel {
diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c
index 2e0f0897af4..a70fbab1aa4 100644
--- a/source/blender/editors/interface/interface_widgets.c
+++ b/source/blender/editors/interface/interface_widgets.c
@@ -1949,7 +1949,7 @@ static void widget_pulldownbut(uiWidgetColors *wcol, rcti *rect, int state, int
widget_init(&wtb);
/* fully rounded */
- round_box_edges(&wtb, roundboxalign, rect, rad);
+ round_box_edges(&wtb, 15, rect, rad);
widgetbase_draw(&wtb, wcol);
}