minor edit for UI code, pointless short/int mix.
authorCampbell Barton <ideasman42@gmail.com>
Mon, 3 Oct 2011 01:01:01 +0000 (01:01 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Mon, 3 Oct 2011 01:01:01 +0000 (01:01 +0000)
source/blender/editors/interface/interface.c
source/blender/editors/interface/interface_handlers.c
source/blender/editors/interface/interface_intern.h
source/blender/editors/interface/interface_layout.c

index a3ae39c844060d1f71be88263be34a4762ec7d51..5ebdf78e611926b46b9aad1c3d3ac97a3cac7197 100644 (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;) {
index 929a8bf1dc66ff042ffeb95c728b519fe2b472f1..81900b0ba39dee1b87e53db53b6a6ea73fad5827 100644 (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;
index 94eb180bd06d33f81e3b97a2dcbc385b761f501e..07ff8699b60d10a9555bedb4b79763f67ba480ed 100644 (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;
index ab07cb4bbf647d30666c6fce85ace86edcf4d9bf..2f10ebf1d73437d561f1e80250d05e1b84bfcd2f 100644 (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;