diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-10-03 05:01:01 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-10-03 05:01:01 +0400 |
commit | f87ab2e907823754685bb22d45c62c2734721fa4 (patch) | |
tree | 7586bf6334d0b32eb4531e5d55dae9d4fdd50015 /source/blender/editors | |
parent | 78968a0fc9851645db4466b918f9d96fcb70f92a (diff) |
minor edit for UI code, pointless short/int mix.
Diffstat (limited to 'source/blender/editors')
4 files changed, 11 insertions, 10 deletions
diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index a3ae39c8440..5ebdf78e611 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -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;) { diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index 929a8bf1dc6..81900b0ba39 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -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; diff --git a/source/blender/editors/interface/interface_intern.h b/source/blender/editors/interface/interface_intern.h index 94eb180bd06..07ff8699b60 100644 --- a/source/blender/editors/interface/interface_intern.h +++ b/source/blender/editors/interface/interface_intern.h @@ -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; diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c index ab07cb4bbf6..2f10ebf1d73 100644 --- a/source/blender/editors/interface/interface_layout.c +++ b/source/blender/editors/interface/interface_layout.c @@ -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; |