minor edit for UI code, pointless short/int mix.

This commit is contained in:
2011-10-03 01:01:01 +00:00
parent 78968a0fc9
commit f87ab2e907
4 changed files with 11 additions and 10 deletions

View File

@@ -2049,7 +2049,7 @@ uiBlock *uiBeginBlock(const bContext *C, ARegion *region, const char *name, shor
wm_subwindow_getsize(window, window->screen->mainwin, &getsizex, &getsizey);
block->aspect= 2.0/fabs(getsizex*block->winmat[0][0]);
block->auto_open= 2;
block->auto_open= TRUE;
block->flag |= UI_BLOCK_LOOP; /* tag as menu */
}
@@ -2291,7 +2291,7 @@ int ui_but_can_align(uiBut *but)
return !ELEM3(but->type, LABEL, OPTION, OPTIONN);
}
static void ui_block_do_align_but(uiBut *first, int nr)
static void ui_block_do_align_but(uiBut *first, short nr)
{
uiBut *prev, *but=NULL, *next;
int flag= 0, cols=0, rows=0;
@@ -2428,7 +2428,7 @@ static void ui_block_do_align_but(uiBut *first, int nr)
void ui_block_do_align(uiBlock *block)
{
uiBut *but;
int nr;
short nr;
/* align buttons with same align nr */
for(but=block->buttons.first; but;) {

View File

@@ -4681,7 +4681,7 @@ static int ui_mouse_inside_region(ARegion *ar, int x, int y)
/* check if the mouse is in the region */
if(!BLI_in_rcti(&ar->winrct, x, y)) {
for(block=ar->uiblocks.first; block; block=block->next)
block->auto_open= 0;
block->auto_open= FALSE;
return 0;
}
@@ -4868,8 +4868,8 @@ static void button_activate_state(bContext *C, uiBut *but, uiHandleButtonState s
if(data->used_mouse && !data->autoopentimer) {
int time;
if(but->block->auto_open==2) time= 1; // test for toolbox
else if((but->block->flag & UI_BLOCK_LOOP && but->type != BLOCK) || but->block->auto_open) time= 5*U.menuthreshold2;
if(but->block->auto_open==TRUE) time= 1; // test for toolbox
else if((but->block->flag & UI_BLOCK_LOOP && but->type != BLOCK) || but->block->auto_open==TRUE) time= 5*U.menuthreshold2;
else if(U.uiflag & USER_MENUOPENAUTO) time= 5*U.menuthreshold1;
else time= -1;
@@ -4967,9 +4967,9 @@ static void button_activate_init(bContext *C, ARegion *ar, uiBut *but, uiButtonA
/* we disable auto_open in the block after a threshold, because we still
* want to allow auto opening adjacent menus even if no button is activated
* in between going over to the other button, but only for a short while */
if(type == BUTTON_ACTIVATE_OVER && but->block->auto_open)
if(type == BUTTON_ACTIVATE_OVER && but->block->auto_open==TRUE)
if(but->block->auto_open_last+BUTTON_AUTO_OPEN_THRESH < PIL_check_seconds_timer())
but->block->auto_open= 0;
but->block->auto_open= FALSE;
if(type == BUTTON_ACTIVATE_OVER) {
data->used_mouse= 1;

View File

@@ -308,7 +308,8 @@ struct uiBlock {
int flag;
char direction;
char dt; /* drawtype: UI_EMBOSS, UI_EMBOSSN ... etc, copied to buttons */
short auto_open;
char pad;
char auto_open;
double auto_open_last;
const char *lockstr;

View File

@@ -2432,7 +2432,7 @@ static void ui_item_estimate(uiItem *item)
}
}
static void ui_item_align(uiLayout *litem, int nr)
static void ui_item_align(uiLayout *litem, short nr)
{
uiItem *item;
uiButtonItem *bitem;