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:
authorTon Roosendaal <ton@blender.org>2009-04-14 19:59:52 +0400
committerTon Roosendaal <ton@blender.org>2009-04-14 19:59:52 +0400
commit5b3d7bfdf6305e880f89d58cbe852a8d2ba7b241 (patch)
treecbe98c77a1d09dcdbc4a1e4130860d5bd3165a3e /source/blender/editors/interface
parent3ef247eed953ea28aca2bc92879ff1c32f04b7f4 (diff)
2.5
More cleanup! - removed old UI font completely, including from uiBeginBlock - emboss hints for uiBlock only have three types now; Regular, Pulldown, or "Nothing" (only icon/text) - removed old font path from Userdef - removed all old button theme hinting - removed old "auto block" to merge buttons in groups (was only in use for radiosity buttons) And went over all warnings. One hooray for make giving clean output :) Well, we need uniform definitions for warnings, so people at least fix them... here's the real bad bugs I found: - in mesh code, a call to editmesh mixed *em and *me - in armature, ED_util.h was not included, so no warnings for wrong call to ED_undo_push() - The extern Py api .h was not included in the bpy_interface.c, showing a several calls using different args. Further just added the missing includes, and removed unused vars.
Diffstat (limited to 'source/blender/editors/interface')
-rw-r--r--source/blender/editors/interface/interface.c160
-rw-r--r--source/blender/editors/interface/interface_draw.c14
-rw-r--r--source/blender/editors/interface/interface_intern.h17
-rw-r--r--source/blender/editors/interface/interface_layout.c13
-rw-r--r--source/blender/editors/interface/interface_panel.c23
-rw-r--r--source/blender/editors/interface/interface_regions.c23
-rw-r--r--source/blender/editors/interface/interface_utils.c27
7 files changed, 51 insertions, 226 deletions
diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c
index 3ce658a174f..2dc0ab6b413 100644
--- a/source/blender/editors/interface/interface.c
+++ b/source/blender/editors/interface/interface.c
@@ -392,68 +392,6 @@ void uiMenuPopupBoundsBlock(uiBlock *block, int addval, int mx, int my)
block->my= my;
}
-void ui_autofill(uiBlock *block)
-{
- uiBut *but;
- float *maxw, *maxh, startx = 0, starty, height = 0;
- float totmaxh;
- int rows=0, /* cols=0, */ i, lasti;
-
- /* first count rows */
- but= block->buttons.last;
- rows= but->x1+1;
-
- /* calculate max width / height for each row */
- maxw= MEM_callocN(sizeof(float)*rows, "maxw");
- maxh= MEM_callocN(sizeof(float)*rows, "maxh");
- but= block->buttons.first;
- while(but) {
- i= but->x1;
- if( maxh[i] < but->y2) maxh[i]= but->y2;
- maxw[i] += but->x2;
- but= but->next;
- }
-
- totmaxh= 0.0;
- for(i=0; i<rows; i++) totmaxh+= maxh[i];
-
- /* apply widths/heights */
- starty= block->maxy;
- but= block->buttons.first;
- lasti= -1;
- while(but) {
- // signal for aligning code
- but->flag |= UI_BUT_ALIGN_DOWN;
-
- i= but->x1;
-
- if(i!=lasti) {
- startx= block->minx;
- height= (maxh[i]*(block->maxy-block->miny))/totmaxh;
- starty-= height;
- lasti= i;
- }
-
- but->y1= starty+but->aspect;
- but->y2= but->y1+height-but->aspect;
-
- but->x2= (but->x2*(block->maxx-block->minx))/maxw[i];
- but->x1= startx+but->aspect;
-
- startx+= but->x2;
- but->x2+= but->x1-but->aspect;
-
- ui_check_but(but);
-
- but= but->next;
- }
-
- uiBlockEndAlign(block);
-
- MEM_freeN(maxw); MEM_freeN(maxh);
- block->autofill= 0;
-}
-
/* ************** LINK LINE DRAWING ************* */
/* link line drawing is not part of buttons or theme.. so we stick with it here */
@@ -469,7 +407,7 @@ static void ui_draw_linkline(uiBut *but, uiLinkLine *line)
vec2[0]= (line->to->x1+line->to->x2)/2.0;
vec2[1]= (line->to->y1+line->to->y2)/2.0;
- if(line->flag & UI_SELECT) UI_ThemeColorShade(but->themecol, 80);
+ if(line->flag & UI_SELECT) glColor3ub(100,100,100);
else glColor3ub(0,0,0);
fdrawline(vec1[0], vec1[1], vec2[0], vec2[1]);
}
@@ -628,7 +566,6 @@ void uiEndBlock(const bContext *C, uiBlock *block)
else if(block->dobounds == 2) ui_text_bounds_block(block, 0.0f);
else if(block->dobounds) ui_popup_bounds_block(C, block, (block->dobounds == 4));
- if(block->autofill) ui_autofill(block);
if(block->minx==0.0 && block->maxx==0.0) uiBoundsBlock(block, 0);
if(block->flag & UI_BUT_ALIGN) uiBlockEndAlign(block);
@@ -1788,7 +1725,7 @@ void uiFreeInactiveBlocks(const bContext *C, ListBase *lb)
}
}
-uiBlock *uiBeginBlock(const bContext *C, ARegion *region, char *name, short dt, short font)
+uiBlock *uiBeginBlock(const bContext *C, ARegion *region, const char *name, short dt)
{
ListBase *lb;
uiBlock *block, *oldblock= NULL;
@@ -1814,6 +1751,7 @@ uiBlock *uiBeginBlock(const bContext *C, ARegion *region, char *name, short dt,
block= MEM_callocN(sizeof(uiBlock), "uiBlock");
block->oldblock= oldblock;
block->active= 1;
+ block->dt= dt;
/* at the beginning of the list! for dynamical menus/blocks */
if(lb)
@@ -1821,9 +1759,6 @@ uiBlock *uiBeginBlock(const bContext *C, ARegion *region, char *name, short dt,
BLI_strncpy(block->name, name, sizeof(block->name));
- block->dt= dt;
- block->themecol= TH_AUTO;
-
/* window matrix and aspect */
if(region->swinid) {
wm_subwindow_getmatrix(window, region->swinid, block->winmat);
@@ -1860,6 +1795,11 @@ uiBlock *uiGetBlock(char *name, ARegion *ar)
return NULL;
}
+void uiBlockSetEmboss(uiBlock *block, short dt)
+{
+ block->dt= dt;
+}
+
void ui_check_but(uiBut *but)
{
/* if something changed in the button */
@@ -2014,41 +1954,6 @@ void ui_check_but(uiBut *but)
/* text clipping moved to widget drawing code itself */
}
-static int ui_auto_themecol(uiBut *but)
-{
- if(but->block->flag & UI_BLOCK_LOOP)
- return TH_MENU_ITEM;
-
- switch(but->type) {
- case BUT:
- return TH_BUT_ACTION;
- case ROW:
- case TOG:
- case TOG3:
- case TOGR:
- case TOGN:
- case BUT_TOGDUAL:
- return TH_BUT_SETTING;
- case SLI:
- case NUM:
- case NUMSLI:
- case NUMABS:
- case HSVSLI:
- return TH_BUT_NUM;
- case TEX:
- return TH_BUT_TEXTFIELD;
- case PULLDOWN:
- case HMENU:
- case BLOCK:
- case MENU:
- case BUTM:
- return TH_BUT_POPUP;
- case ROUNDBOX:
- return TH_PANEL;
- default:
- return TH_BUT_NEUTRAL;
- }
-}
void uiBlockBeginAlign(uiBlock *block)
{
@@ -2252,7 +2157,6 @@ static uiBut *ui_def_but(uiBlock *block, int type, int retval, char *str, short
but->bit= type & BIT;
but->bitnr= type & 31;
but->icon = 0;
- but->dt= block->dt;
but->retval= retval;
if( strlen(str)>=UI_MAX_NAME_STR-1 ) {
@@ -2265,14 +2169,9 @@ static uiBut *ui_def_but(uiBlock *block, int type, int retval, char *str, short
}
but->x1= x1;
but->y1= y1;
- if(block->autofill) {
- but->x2= x2;
- but->y2= y2;
- }
- else {
- but->x2= (x1+x2);
- but->y2= (y1+y2);
- }
+ but->x2= (x1+x2);
+ but->y2= (y1+y2);
+
but->poin= poin;
but->hardmin= but->softmin= min;
but->hardmax= but->softmax= max;
@@ -2280,18 +2179,13 @@ static uiBut *ui_def_but(uiBlock *block, int type, int retval, char *str, short
but->a2= a2;
but->tip= tip;
- but->font= block->curfont;
-
but->lock= block->lock;
but->lockstr= block->lockstr;
+ but->dt= block->dt;
but->aspect= 1.0f; //XXX block->aspect;
- but->win= block->win;
but->block= block; // pointer back, used for frontbuffer status, and picker
- if(block->themecol==TH_AUTO) but->themecol= ui_auto_themecol(but);
- else but->themecol= block->themecol;
-
but->func= block->func;
but->func_arg1= block->func_arg1;
but->func_arg2= block->func_arg2;
@@ -2915,17 +2809,6 @@ uiBut *uiDefMenuTogR(uiBlock *block, PointerRNA *ptr, char *propname, char *prop
/* END Button containing both string label and icon */
-void uiAutoBlock(uiBlock *block, float minx, float miny, float sizex, float sizey, int flag)
-{
- block->minx= minx;
- block->maxx= minx+sizex;
- block->miny= miny;
- block->maxy= miny+sizey;
-
- block->autofill= flag; /* also check for if it has to be done */
-
-}
-
void uiSetButLink(uiBut *but, void **poin, void ***ppoin, short *tot, int from, int to)
{
uiLink *link;
@@ -2953,18 +2836,6 @@ int uiBlocksGetYMin(ListBase *lb)
return min;
}
-int uiBlockGetCol(uiBlock *block)
-{
- return block->themecol;
-}
-void uiBlockSetCol(uiBlock *block, int col)
-{
- block->themecol= col;
-}
-void uiBlockSetEmboss(uiBlock *block, int emboss)
-{
- block->dt= emboss;
-}
void uiBlockSetDirection(uiBlock *block, int direction)
{
block->direction= direction;
@@ -3010,23 +2881,22 @@ void uiBlockSetFlag(uiBlock *block, int flag)
{
block->flag|= flag;
}
+
void uiBlockClearFlag(uiBlock *block, int flag)
{
block->flag&= ~flag;
}
+
void uiBlockSetXOfs(uiBlock *block, int xofs)
{
block->xofs= xofs;
}
-void* uiBlockGetCurFont(uiBlock *block)
-{
- return block->curfont;
-}
void uiButSetFlag(uiBut *but, int flag)
{
but->flag|= flag;
}
+
void uiButClearFlag(uiBut *but, int flag)
{
but->flag&= ~flag;
diff --git a/source/blender/editors/interface/interface_draw.c b/source/blender/editors/interface/interface_draw.c
index 8dba795d2cf..153db7aa77d 100644
--- a/source/blender/editors/interface/interface_draw.c
+++ b/source/blender/editors/interface/interface_draw.c
@@ -656,7 +656,7 @@ static void ui_draw_but_CHARTAB(uiBut *but)
/* resets the font size */
if(G.ui_international == TRUE)
{
- uiSetCurFont(but->block, UI_HELV);
+ // uiSetCurFont(but->block, UI_HELV);
}
}
@@ -1040,18 +1040,6 @@ void ui_draw_but_CURVE(ARegion *ar, uiBut *but, rcti *rect)
}
-void ui_draw_roundbox(uiBut *but)
-{
- glEnable(GL_BLEND);
-
- UI_ThemeColorShadeAlpha(but->themecol, but->a2, but->a2);
-
- uiSetRoundBox(but->a1);
- gl_round_box(GL_POLYGON, but->x1, but->y1, but->x2, but->y2, but->hardmin);
-
- glDisable(GL_BLEND);
-}
-
/* ****************************************************** */
diff --git a/source/blender/editors/interface/interface_intern.h b/source/blender/editors/interface/interface_intern.h
index 776f36551c9..eb32c29c8c7 100644
--- a/source/blender/editors/interface/interface_intern.h
+++ b/source/blender/editors/interface/interface_intern.h
@@ -39,7 +39,6 @@ struct IDProperty;
struct uiHandleButtonData;
struct wmEvent;
struct wmWindow;
-struct uiFontStyle;
struct uiStyle;
/* ****************** general defines ************** */
@@ -121,9 +120,6 @@ typedef struct {
short xofs, yofs;
} uiIconImage;
-typedef struct {
- void *xl, *large, *medium, *small;
-} uiFontOld;
typedef struct uiLinkLine { /* only for draw/edit */
struct uiLinkLine *next, *prev;
@@ -177,9 +173,6 @@ struct uiBut {
char *tip, *lockstr;
- int themecol; /* themecolor id */
- void *font;
-
BIFIconID icon;
short but_align; /* aligning buttons, horiz/vertical */
short lock, win;
@@ -246,14 +239,10 @@ struct uiBlock {
/* extra draw function for custom blocks */
void (*drawextra)();
- int themecol; /* themecolor id */
-
- short font; /* indices */
int afterval, flag;
- void *curfont;
- short autofill, win, winq, direction, dt;
- short auto_open, in_use, pad;
+ short direction, dt;
+ short auto_open, in_use;
double auto_open_last;
int lock;
@@ -269,7 +258,6 @@ struct uiBlock {
uiPopupBlockHandle *handle; // handle
int tooltipdisabled; // to avoid tooltip after click
- int handler; // for panels in other windows than buttonswin... just event code
int active; // to keep blocks while drawing and free them afterwards
};
@@ -305,7 +293,6 @@ extern int ui_get_but_string_max_length(uiBut *but);
extern void ui_set_but_soft_range(uiBut *but, double value);
extern void ui_check_but(uiBut *but);
-extern void ui_autofill(uiBlock *block);
extern int ui_is_but_float(uiBut *but);
extern void ui_update_block_buts_hsv(uiBlock *block, float *hsv);
diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c
index e5e9706c25b..786d819674c 100644
--- a/source/blender/editors/interface/interface_layout.c
+++ b/source/blender/editors/interface/interface_layout.c
@@ -922,12 +922,11 @@ void uiTemplateSlot(uiLayout *layout, int slot)
static void ui_layout_templates(const bContext *C, uiBlock *block, uiLayout *layout)
{
uiTemplate *template;
- int oldcolor= 0;
for(template=layout->templates.first; template; template=template->next) {
if(template->color) {
- oldcolor= uiBlockGetCol(block);
- uiBlockSetCol(block, template->color);
+ // XXX oldcolor= uiBlockGetCol(block);
+ // XXX uiBlockSetCol(block, template->color);
}
switch(template->type) {
@@ -954,8 +953,8 @@ static void ui_layout_templates(const bContext *C, uiBlock *block, uiLayout *lay
break;
}
- if(template->color)
- uiBlockSetCol(block, oldcolor);
+// XXX if(template->color)
+// XXX uiBlockSetCol(block, oldcolor);
if(layout->dir == UI_LAYOUT_HORIZONTAL)
layout->x += TEMPLATE_SPACE;
@@ -1038,7 +1037,7 @@ void uiRegionPanelLayout(const bContext *C, ARegion *ar, int vertical, char *con
continue;
if(pt->draw && (!pt->poll || pt->poll(C))) {
- block= uiBeginBlock(C, ar, pt->idname, UI_EMBOSS, UI_HELV);
+ block= uiBeginBlock(C, ar, pt->idname, UI_EMBOSS);
if(vertical)
w= (ar->type->minsizex)? ar->type->minsizex-12: block->aspect*ar->winx-12;
@@ -1103,7 +1102,7 @@ void uiRegionHeaderLayout(const bContext *C, ARegion *ar)
/* draw all headers types */
for(ht= ar->type->headertypes.first; ht; ht= ht->next) {
- block= uiBeginBlock(C, ar, "header buttons", UI_EMBOSS, UI_HELV);
+ block= uiBeginBlock(C, ar, "header buttons", UI_EMBOSS);
layout= uiLayoutBegin(UI_LAYOUT_HORIZONTAL, xco, yco, 0, 24);
if(ht->draw)
diff --git a/source/blender/editors/interface/interface_panel.c b/source/blender/editors/interface/interface_panel.c
index ea1ab0566a5..261d36cf38e 100644
--- a/source/blender/editors/interface/interface_panel.c
+++ b/source/blender/editors/interface/interface_panel.c
@@ -212,7 +212,6 @@ int uiNewPanel(const bContext *C, ARegion *ar, uiBlock *block, char *panelname,
}
block->panel= pa;
- block->handler= pnl_handler;
pa->active= 1;
pa->control= pnl_control;
@@ -299,7 +298,6 @@ static void ui_scale_panel_block(uiBlock *block)
if(block->panel==NULL) return;
- if(block->autofill) ui_autofill(block);
/* buttons min/max centered, offset calculated */
ui_bounds_block(block);
@@ -365,12 +363,10 @@ void uiPanelsHome(ARegion *ar)
/* no panels, but old 'loose' buttons, as in old logic editor */
for(block= ar->uiblocks.first; block; block= block->next) {
- //XXX 2.50 if(block->win==sa->win) {
- if(block->minx < v2d->tot.xmin) v2d->tot.xmin= block->minx;
- if(block->maxx > v2d->tot.xmax) v2d->tot.xmax= block->maxx;
- if(block->miny < v2d->tot.ymin) v2d->tot.ymin= block->miny;
- if(block->maxy > v2d->tot.ymax) v2d->tot.ymax= block->maxy;
- //XXX }
+ if(block->minx < v2d->tot.xmin) v2d->tot.xmin= block->minx;
+ if(block->maxx > v2d->tot.xmax) v2d->tot.xmax= block->maxx;
+ if(block->miny < v2d->tot.ymin) v2d->tot.ymin= block->miny;
+ if(block->maxy > v2d->tot.ymax) v2d->tot.ymax= block->maxy;
}
}
}
@@ -408,12 +404,10 @@ static void ui_panels_update_totrct(ARegion *ar)
if(done==0) {
/* no panels, but old 'loose' buttons, as in old logic editor */
for(block= ar->uiblocks.first; block; block= block->next) {
- //XXX 2.50 if(block->win==sa->win) {
- if(block->minx < v2d->tot.xmin) v2d->tot.xmin= block->minx;
- if(block->maxx > v2d->tot.xmax) v2d->tot.xmax= block->maxx;
- if(block->miny < v2d->tot.ymin) v2d->tot.ymin= block->miny;
- if(block->maxy > v2d->tot.ymax) v2d->tot.ymax= block->maxy;
- //XXX }
+ if(block->minx < v2d->tot.xmin) v2d->tot.xmin= block->minx;
+ if(block->maxx > v2d->tot.xmax) v2d->tot.xmax= block->maxx;
+ if(block->miny < v2d->tot.ymin) v2d->tot.ymin= block->miny;
+ if(block->maxy > v2d->tot.ymax) v2d->tot.ymax= block->maxy;
}
}
@@ -1313,7 +1307,6 @@ static void ui_handle_panel_header(bContext *C, uiBlock *block, int mx, int my)
if(button) {
if(button==2) { // close
- //XXX 2.50 rem_blockhandler(sa, block->handler);
ED_region_tag_redraw(ar);
}
else { // collapse
diff --git a/source/blender/editors/interface/interface_regions.c b/source/blender/editors/interface/interface_regions.c
index 85091fc45c2..b730cbab238 100644
--- a/source/blender/editors/interface/interface_regions.c
+++ b/source/blender/editors/interface/interface_regions.c
@@ -324,7 +324,6 @@ ARegion *ui_tooltip_create(bContext *C, ARegion *butregion, uiBut *but)
/* create tooltip data */
data= MEM_callocN(sizeof(uiTooltipData), "uiTooltipData");
data->tip= BLI_strdup(but->tip);
- data->font= but->font;
data->aspect= but->aspect;
/* set font, get bb */
@@ -738,10 +737,8 @@ uiBlock *ui_block_func_MENU(bContext *C, uiPopupBlockHandle *handle, void *arg_b
int width, height, boxh, columns, rows, startx, starty, x1, y1, xmax, a;
/* create the block */
- block= uiBeginBlock(C, handle->region, "menu", UI_EMBOSSP, UI_HELV);
- block->dt= UI_EMBOSSP;
+ block= uiBeginBlock(C, handle->region, "menu", UI_EMBOSSP);
block->flag= UI_BLOCK_LOOP|UI_BLOCK_REDRAW|UI_BLOCK_NUMSELECT;
- block->themecol= TH_MENU_ITEM;
/* compute menu data */
md= decompose_menu_string(but->str);
@@ -848,9 +845,8 @@ uiBlock *ui_block_func_ICONROW(bContext *C, uiPopupBlockHandle *handle, void *ar
uiBlock *block;
int a;
- block= uiBeginBlock(C, handle->region, "menu", UI_EMBOSSP, UI_HELV);
+ block= uiBeginBlock(C, handle->region, "menu", UI_EMBOSSP);
block->flag= UI_BLOCK_LOOP|UI_BLOCK_REDRAW|UI_BLOCK_NUMSELECT;
- block->themecol= TH_MENU_ITEM;
for(a=(int)but->hardmin; a<=(int)but->hardmax; a++) {
uiDefIconButF(block, BUTM|FLO, B_NOP, but->icon+(a-but->hardmin), 0, (short)(18*a), (short)(but->x2-but->x1-4), 18, &handle->retvalue, (float)a, 0.0, 0, 0, "");
@@ -870,9 +866,8 @@ uiBlock *ui_block_func_ICONTEXTROW(bContext *C, uiPopupBlockHandle *handle, void
MenuData *md;
int width, xmax, ypos, a;
- block= uiBeginBlock(C, handle->region, "menu", UI_EMBOSSP, UI_HELV);
+ block= uiBeginBlock(C, handle->region, "menu", UI_EMBOSSP);
block->flag= UI_BLOCK_LOOP|UI_BLOCK_REDRAW|UI_BLOCK_NUMSELECT;
- block->themecol= TH_MENU_ITEM;
md= decompose_menu_string(but->str);
@@ -1274,9 +1269,8 @@ uiBlock *ui_block_func_COL(bContext *C, uiPopupBlockHandle *handle, void *arg_bu
static float hsvcol[3], oldcol[3];
static char hexcol[128];
- block= uiBeginBlock(C, handle->region, "colorpicker", UI_EMBOSS, UI_HELV);
+ block= uiBeginBlock(C, handle->region, "colorpicker", UI_EMBOSS);
block->flag= UI_BLOCK_LOOP|UI_BLOCK_REDRAW|UI_BLOCK_KEEP_OPEN;
- block->themecol= TH_BUT_NUM;
VECCOPY(handle->retvec, but->editvec);
uiBlockPickerButtons(block, handle->retvec, hsvcol, oldcol, hexcol, 'p', 0);
@@ -1342,9 +1336,8 @@ uiBlock *ui_block_func_PUPMENU(bContext *C, uiPopupBlockHandle *handle, void *ar
height= 0;
/* block stuff first, need to know the font */
- block= uiBeginBlock(C, handle->region, "menu", UI_EMBOSSP, UI_HELV);
+ block= uiBeginBlock(C, handle->region, "menu", UI_EMBOSSP);
uiBlockSetFlag(block, UI_BLOCK_LOOP|UI_BLOCK_REDRAW|UI_BLOCK_RET_1|UI_BLOCK_NUMSELECT);
- block->themecol= TH_MENU_ITEM;
block->direction= UI_DOWN;
md= decompose_menu_string(info->instr);
@@ -1504,9 +1497,8 @@ uiBlock *ui_block_func_PUPMENUCOL(bContext *C, uiPopupBlockHandle *handle, void
height= 0;
/* block stuff first, need to know the font */
- block= uiBeginBlock(C, handle->region, "menu", UI_EMBOSSP, UI_HELV);
+ block= uiBeginBlock(C, handle->region, "menu", UI_EMBOSSP);
uiBlockSetFlag(block, UI_BLOCK_LOOP|UI_BLOCK_REDRAW|UI_BLOCK_RET_1|UI_BLOCK_NUMSELECT);
- block->themecol= TH_MENU_ITEM;
block->direction= UI_DOWN;
md= decompose_menu_string(info->instr);
@@ -1765,9 +1757,8 @@ static uiBlock *ui_block_func_MENU_ITEM(bContext *C, uiPopupBlockHandle *handle,
/* block stuff first, need to know the font */
sprintf(str, "tb %d", counter++);
- block= uiBeginBlock(C, handle->region, str, UI_EMBOSSP, UI_HELV);
+ block= uiBeginBlock(C, handle->region, str, UI_EMBOSSP);
uiBlockSetButmFunc(block, head->eventfunc, head->argv);
- block->themecol= TH_MENU_ITEM;
block->direction= UI_DOWN;
width= 50; // fixed with, uiMenuPopupBoundsBlock will compute actual width
diff --git a/source/blender/editors/interface/interface_utils.c b/source/blender/editors/interface/interface_utils.c
index d8d193d98b0..d91dadf58f7 100644
--- a/source/blender/editors/interface/interface_utils.c
+++ b/source/blender/editors/interface/interface_utils.c
@@ -419,7 +419,7 @@ int uiDefIDPoinButs(uiBlock *block, Main *bmain, ID *parid, ID *id, int id_code,
uiBut *but;
uiIDPoinParams *params, *dup_params;
char *str=NULL, str1[10];
- int len, oldcol, add_addbutton=0;
+ int len, add_addbutton=0;
/* setup struct that we will pass on with the buttons */
params= MEM_callocN(sizeof(uiIDPoinParams), "uiIDPoinParams");
@@ -431,14 +431,15 @@ int uiDefIDPoinButs(uiBlock *block, Main *bmain, ID *parid, ID *id, int id_code,
/* create buttons */
uiBlockBeginAlign(block);
- oldcol= uiBlockGetCol(block);
+ /* XXX solve?
if(id && id->us>1)
uiBlockSetCol(block, TH_BUT_SETTING1);
if((events & UI_ID_PIN) && *pin_p)
uiBlockSetCol(block, TH_BUT_SETTING2);
-
+ */
+
/* pin button */
if(id && (events & UI_ID_PIN)) {
but= uiDefIconButS(block, ICONTOG, (events & UI_ID_PIN), ICON_KEY_DEHLT, x, y ,DEF_ICON_BUT_WIDTH,DEF_BUT_HEIGHT, pin_p, 0, 0, 0, 0, "Keeps this view displaying the current data regardless of what object is selected");
@@ -488,22 +489,20 @@ int uiDefIDPoinButs(uiBlock *block, Main *bmain, ID *parid, ID *id, int id_code,
MEM_freeN(str);
}
- uiBlockSetCol(block, oldcol);
-
/* text button with name */
if(id) {
- /* name */
+ /* XXX solve?
if(id->us > 1)
uiBlockSetCol(block, TH_BUT_SETTING1);
-
- /* pinned data? */
+ */
+ /* pinned data?
if((events & UI_ID_PIN) && *pin_p)
uiBlockSetCol(block, TH_BUT_SETTING2);
-
- /* redalert overrides pin color */
+ */
+ /* redalert overrides pin color
if(id->us<=0)
uiBlockSetCol(block, TH_REDALERT);
-
+ */
uiBlockSetButLock(block, id->lib!=0, "Can't edit external libdata");
/* name button */
@@ -592,7 +591,6 @@ int uiDefIDPoinButs(uiBlock *block, Main *bmain, ID *parid, ID *id, int id_code,
}
/* add new button */
else if(add_addbutton) {
- uiBlockSetCol(block, oldcol);
if(parid) uiBlockSetButLock(block, parid->lib!=0, "Can't edit external libdata");
dup_params= MEM_dupallocN(params);
but= uiDefButS(block, TOG, 0, "Add New", x, y, 110, DEF_BUT_HEIGHT, &dup_params->browsenr, params->browsenr, 32767.0, 0, 0, "Add new data block");
@@ -600,7 +598,6 @@ int uiDefIDPoinButs(uiBlock *block, Main *bmain, ID *parid, ID *id, int id_code,
x+= 110;
}
- uiBlockSetCol(block, oldcol);
uiBlockEndAlign(block);
MEM_freeN(params);
@@ -915,7 +912,7 @@ static uiBlock *curvemap_clipping_func(struct bContext *C, struct ARegion *ar, v
uiBlock *block;
uiBut *bt;
- block= uiBeginBlock(C, ar, "curvemap_clipping_func", UI_EMBOSS, UI_HELV);
+ block= uiBeginBlock(C, ar, "curvemap_clipping_func", UI_EMBOSS);
/* use this for a fake extra empy space around the buttons */
uiDefBut(block, LABEL, 0, "", -4, 16, 128, 106, NULL, 0, 0, 0, 0, "");
@@ -975,7 +972,7 @@ static uiBlock *curvemap_tools_func(struct bContext *C, struct ARegion *ar, void
uiBlock *block;
short yco= 0, menuwidth=120;
- block= uiBeginBlock(C, ar, "curvemap_tools_func", UI_EMBOSSP, UI_HELV);
+ block= uiBeginBlock(C, ar, "curvemap_tools_func", UI_EMBOSS);
uiBlockSetButmFunc(block, curvemap_tools_dofunc, cumap_v);
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Reset View", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, "");