2.6 UI code:
authorThomas Dinges <blender@dingto.org>
Wed, 23 Nov 2011 19:05:52 +0000 (19:05 +0000)
committerThomas Dinges <blender@dingto.org>
Wed, 23 Nov 2011 19:05:52 +0000 (19:05 +0000)
* Get rid of subrow/subcol variable names in the C UI code as well, use sub instead. This is shorter and sufficient.
* Minor layout alignment fixes.
* Greying out in NLA editor was doing nothing for "strip_time" property.

source/blender/editors/animation/fmodifier_ui.c
source/blender/editors/gpencil/gpencil_buttons.c
source/blender/editors/space_graph/graph_buttons.c
source/blender/editors/space_image/image_buttons.c
source/blender/editors/space_logic/logic_window.c
source/blender/editors/space_nla/nla_buttons.c

index d329874e1baecf2f940315108419496d70488b79..05f9248e0a64833a4f7ebf250685784ffe266870 100644 (file)
@@ -569,7 +569,7 @@ static void draw_modifier__limits(uiLayout *layout, ID *id, FModifier *fcm, shor
 /* draw settings for stepped interpolation modifier */
 static void draw_modifier__stepped(uiLayout *layout, ID *id, FModifier *fcm, short UNUSED(width))
 {
-       uiLayout *col, *subcol;
+       uiLayout *col, *sub;
        PointerRNA ptr;
        
        /* init the RNA-pointer */
@@ -584,17 +584,17 @@ static void draw_modifier__stepped(uiLayout *layout, ID *id, FModifier *fcm, sho
        col= uiLayoutColumn(layout, 1);
                uiItemR(col, &ptr, "use_frame_start", 0, NULL, ICON_NONE);
                
-               subcol = uiLayoutColumn(col, 1);
-               uiLayoutSetActive(subcol, RNA_boolean_get(&ptr, "use_frame_start"));
-                       uiItemR(subcol, &ptr, "frame_start", 0, NULL, ICON_NONE);
+               sub = uiLayoutColumn(col, 1);
+               uiLayoutSetActive(sub, RNA_boolean_get(&ptr, "use_frame_start"));
+                       uiItemR(sub, &ptr, "frame_start", 0, NULL, ICON_NONE);
                        
        /* block 3: end range settings */
        col= uiLayoutColumn(layout, 1);
                uiItemR(col, &ptr, "use_frame_end", 0, NULL, ICON_NONE);
                
-               subcol = uiLayoutColumn(col, 1);
-               uiLayoutSetActive(subcol, RNA_boolean_get(&ptr, "use_frame_end"));
-                       uiItemR(subcol, &ptr, "frame_end", 0, NULL, ICON_NONE);
+               sub = uiLayoutColumn(col, 1);
+               uiLayoutSetActive(sub, RNA_boolean_get(&ptr, "use_frame_end"));
+                       uiItemR(sub, &ptr, "frame_end", 0, NULL, ICON_NONE);
 }
 
 /* --------------- */
@@ -602,7 +602,7 @@ static void draw_modifier__stepped(uiLayout *layout, ID *id, FModifier *fcm, sho
 void ANIM_uiTemplate_fmodifier_draw (uiLayout *layout, ID *id, ListBase *modifiers, FModifier *fcm)
 {
        FModifierTypeInfo *fmi= fmodifier_get_typeinfo(fcm);
-       uiLayout *box, *row, *subrow, *col;
+       uiLayout *box, *row, *sub, *col;
        uiBlock *block;
        uiBut *but;
        short width= 314;
@@ -620,30 +620,30 @@ void ANIM_uiTemplate_fmodifier_draw (uiLayout *layout, ID *id, ListBase *modifie
                block= uiLayoutGetBlock(row); // err...
                
                /* left-align -------------------------------------------- */
-               subrow= uiLayoutRow(row, 1);
-               uiLayoutSetAlignment(subrow, UI_LAYOUT_ALIGN_LEFT);
+               sub= uiLayoutRow(row, 1);
+               uiLayoutSetAlignment(sub, UI_LAYOUT_ALIGN_LEFT);
                
                uiBlockSetEmboss(block, UI_EMBOSSN);
                
                /* expand */
-               uiItemR(subrow, &ptr, "show_expanded", UI_ITEM_R_ICON_ONLY, "", ICON_NONE);
+               uiItemR(sub, &ptr, "show_expanded", UI_ITEM_R_ICON_ONLY, "", ICON_NONE);
                
                /* checkbox for 'active' status (for now) */
-               uiItemR(subrow, &ptr, "active", UI_ITEM_R_ICON_ONLY, "", ICON_NONE);
+               uiItemR(sub, &ptr, "active", UI_ITEM_R_ICON_ONLY, "", ICON_NONE);
                
                /* name */
                if (fmi)
-                       uiItemL(subrow, fmi->name, ICON_NONE);
+                       uiItemL(sub, fmi->name, ICON_NONE);
                else
-                       uiItemL(subrow, "<Unknown Modifier>", ICON_NONE);
+                       uiItemL(sub, "<Unknown Modifier>", ICON_NONE);
                
                /* right-align ------------------------------------------- */
-               subrow= uiLayoutRow(row, 1);
-               uiLayoutSetAlignment(subrow, UI_LAYOUT_ALIGN_RIGHT);
+               sub= uiLayoutRow(row, 1);
+               uiLayoutSetAlignment(sub, UI_LAYOUT_ALIGN_RIGHT);
                
                
                /* 'mute' button */
-               uiItemR(subrow, &ptr, "mute", UI_ITEM_R_ICON_ONLY, "", ICON_NONE);
+               uiItemR(sub, &ptr, "mute", UI_ITEM_R_ICON_ONLY, "", ICON_NONE);
                
                uiBlockSetEmboss(block, UI_EMBOSSN);
                
index 192f5c10d0775e941485674cf56326f63aaf25ff..57dd1ef55725913905b6edecd0650fd81a35d0b9 100644 (file)
@@ -95,8 +95,8 @@ static void gp_ui_dellayer_cb (bContext *C, void *gpd, void *gpl)
 static void gp_drawui_layer (uiLayout *layout, bGPdata *gpd, bGPDlayer *gpl, const short is_v3d)
 {
        uiLayout *box=NULL, *split=NULL;
-       uiLayout *col=NULL, *subcol=NULL;
-       uiLayout *row=NULL, *subrow=NULL;
+       uiLayout *col=NULL;
+       uiLayout *row=NULL, *sub=NULL;
        uiBlock *block;
        uiBut *but;
        PointerRNA ptr;
@@ -120,17 +120,17 @@ static void gp_drawui_layer (uiLayout *layout, bGPdata *gpd, bGPDlayer *gpl, con
        uiBlockSetEmboss(block, UI_EMBOSSN);
        
        /* left-align ............................... */
-       subrow= uiLayoutRow(row, 0);
+       sub= uiLayoutRow(row, 0);
        
        /* active */
-       block= uiLayoutGetBlock(subrow);
+       block= uiLayoutGetBlock(sub);
        icon= (gpl->flag & GP_LAYER_ACTIVE) ? ICON_RADIOBUT_ON : ICON_RADIOBUT_OFF;
        but= uiDefIconBut(block, BUT, 0, icon, 0, 0, UI_UNIT_X, UI_UNIT_Y, NULL, 0.0, 0.0, 0.0, 0.0, "Set active layer");
        uiButSetFunc(but, gp_ui_activelayer_cb, gpd, gpl);
 
        /* locked */
        icon= (gpl->flag & GP_LAYER_LOCKED) ? ICON_LOCKED : ICON_UNLOCKED;
-       uiItemR(subrow, &ptr, "lock", 0, "", icon);
+       uiItemR(sub, &ptr, "lock", 0, "", icon);
        
        /* when layer is locked or hidden, only draw header */
        if (gpl->flag & (GP_LAYER_LOCKED|GP_LAYER_HIDE)) {
@@ -138,7 +138,7 @@ static void gp_drawui_layer (uiLayout *layout, bGPdata *gpd, bGPDlayer *gpl, con
                
                /* visibility button (only if hidden but not locked!) */
                if ((gpl->flag & GP_LAYER_HIDE) && !(gpl->flag & GP_LAYER_LOCKED))
-                       uiItemR(subrow, &ptr, "hide", 0, "", ICON_RESTRICT_VIEW_ON); 
+                       uiItemR(sub, &ptr, "hide", 0, "", ICON_RESTRICT_VIEW_ON); 
                        
                
                /* name */
@@ -146,14 +146,14 @@ static void gp_drawui_layer (uiLayout *layout, bGPdata *gpd, bGPDlayer *gpl, con
                        sprintf(name, "%s (Hidden)", gpl->info);
                else
                        sprintf(name, "%s (Locked)", gpl->info);
-               uiItemL(subrow, name, ICON_NONE);
+               uiItemL(sub, name, ICON_NONE);
                        
                /* delete button (only if hidden but not locked!) */
                if ((gpl->flag & GP_LAYER_HIDE) && !(gpl->flag & GP_LAYER_LOCKED)) {
                        /* right-align ............................... */
-                       subrow= uiLayoutRow(row, 1);
-                       uiLayoutSetAlignment(subrow, UI_LAYOUT_ALIGN_RIGHT);
-                       block= uiLayoutGetBlock(subrow); // XXX... err...
+                       sub= uiLayoutRow(row, 1);
+                       uiLayoutSetAlignment(sub, UI_LAYOUT_ALIGN_RIGHT);
+                       block= uiLayoutGetBlock(sub); // XXX... err...
                        
                        but= uiDefIconBut(block, BUT, 0, ICON_X, 0, 0, UI_UNIT_X, UI_UNIT_Y, NULL, 0.0, 0.0, 0.0, 0.0, "Delete layer");
                        uiButSetFunc(but, gp_ui_dellayer_cb, gpd, gpl);
@@ -163,24 +163,24 @@ static void gp_drawui_layer (uiLayout *layout, bGPdata *gpd, bGPDlayer *gpl, con
        else {
                /* draw rest of header -------------------------------- */
                /* visibility button */
-               uiItemR(subrow, &ptr, "hide", 0, "", ICON_RESTRICT_VIEW_OFF); 
+               uiItemR(sub, &ptr, "hide", 0, "", ICON_RESTRICT_VIEW_OFF); 
                
                /* frame locking */
                // TODO: this needs its own icons...
                icon= (gpl->flag & GP_LAYER_FRAMELOCK) ? ICON_RENDER_STILL : ICON_RENDER_ANIMATION;
-               uiItemR(subrow, &ptr, "lock_frame", 0, "", icon); 
+               uiItemR(sub, &ptr, "lock_frame", 0, "", icon); 
                
                uiBlockSetEmboss(block, UI_EMBOSS);
                
                /* name */
-               uiItemR(subrow, &ptr, "info", 0, "", ICON_NONE);
+               uiItemR(sub, &ptr, "info", 0, "", ICON_NONE);
                
                /* delete 'button' */
                uiBlockSetEmboss(block, UI_EMBOSSN);
                        /* right-align ............................... */
-                       subrow= uiLayoutRow(row, 1);
-                       uiLayoutSetAlignment(subrow, UI_LAYOUT_ALIGN_RIGHT);
-                       block= uiLayoutGetBlock(subrow); // XXX... err...
+                       sub= uiLayoutRow(row, 1);
+                       uiLayoutSetAlignment(sub, UI_LAYOUT_ALIGN_RIGHT);
+                       block= uiLayoutGetBlock(sub); // XXX... err...
                        
                        but= uiDefIconBut(block, BUT, 0, ICON_X, 0, 0, UI_UNIT_X, UI_UNIT_Y, NULL, 0.0, 0.0, 0.0, 0.0, "Delete layer");
                        uiButSetFunc(but, gp_ui_dellayer_cb, gpd, gpl);
@@ -196,32 +196,29 @@ static void gp_drawui_layer (uiLayout *layout, bGPdata *gpd, bGPDlayer *gpl, con
                col= uiLayoutColumn(split, 0);
                
                /* color */
-               subcol= uiLayoutColumn(col, 1);
-                       uiItemR(subcol, &ptr, "color", 0, "", ICON_NONE);
-                       uiItemR(subcol, &ptr, "alpha", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
+               sub= uiLayoutColumn(col, 1);
+                       uiItemR(sub, &ptr, "color", 0, "", ICON_NONE);
+                       uiItemR(sub, &ptr, "alpha", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
                        
                /* stroke thickness */
-               subcol= uiLayoutColumn(col, 1);
-                       uiItemR(subcol, &ptr, "line_width", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
+               uiItemR(col, &ptr, "line_width", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
                
                /* debugging options */
                if (G.f & G_DEBUG) {
-                       subcol= uiLayoutColumn(col, 1);
-                               uiItemR(subcol, &ptr, "show_points", 0, NULL, ICON_NONE);
+                       uiItemR(col, &ptr, "show_points", 0, NULL, ICON_NONE);
                }
                
                /* right column ................... */
                col= uiLayoutColumn(split, 0);
                
                /* onion-skinning */
-               subcol= uiLayoutColumn(col, 1);
-                       uiItemR(subcol, &ptr, "use_onion_skinning", 0, "Onion Skinning", ICON_NONE);
-                       uiItemR(subcol, &ptr, "ghost_range_max", 0, "Frames", ICON_NONE); // XXX shorter name here? i.e. GStep
+               sub= uiLayoutColumn(col, 1);
+                       uiItemR(sub, &ptr, "use_onion_skinning", 0, "Onion Skinning", ICON_NONE);
+                       uiItemR(sub, &ptr, "ghost_range_max", 0, "Frames", ICON_NONE); // XXX shorter name here? i.e. GStep
                
                /* 3d-view specific drawing options */
                if (is_v3d) {
-                       subcol= uiLayoutColumn(col, 0);
-                               uiItemR(subcol, &ptr, "show_x_ray", 0, "X-Ray", ICON_NONE);
+                       uiItemR(col, &ptr, "show_x_ray", 0, "X-Ray", ICON_NONE);
                }
                
        }
index 51a24044deb8955e11bfbaea31ab1e90adab4c20..c1dfa97a5088e2a8b02c72bb7d975af51c95058f 100644 (file)
@@ -136,7 +136,7 @@ static void graph_panel_view(const bContext *C, Panel *pa)
        SpaceIpo *sipo= CTX_wm_space_graph(C);
        Scene *scene= CTX_data_scene(C);
        PointerRNA spaceptr, sceneptr;
-       uiLayout *col, *subcol, *row;
+       uiLayout *col, *sub, *row;
        
        /* get RNA pointers for use when creating the UI elements */
        RNA_id_pointer_create(&scene->id, &sceneptr);
@@ -146,16 +146,16 @@ static void graph_panel_view(const bContext *C, Panel *pa)
        col= uiLayoutColumn(pa->layout, 0);
                uiItemR(col, &spaceptr, "show_cursor", 0, NULL, ICON_NONE);
                
-               subcol= uiLayoutColumn(col, 1);
-               uiLayoutSetActive(subcol, RNA_boolean_get(&spaceptr, "show_cursor")); 
-                       uiItemO(subcol, "Cursor from Selection", ICON_NONE, "GRAPH_OT_frame_jump");
+               sub= uiLayoutColumn(col, 1);
+               uiLayoutSetActive(sub, RNA_boolean_get(&spaceptr, "show_cursor")); 
+                       uiItemO(sub, "Cursor from Selection", ICON_NONE, "GRAPH_OT_frame_jump");
                
-               subcol= uiLayoutColumn(col, 1);
-               uiLayoutSetActive(subcol, RNA_boolean_get(&spaceptr, "show_cursor")); 
-                       row= uiLayoutSplit(subcol, 0.7, 1);
+               sub= uiLayoutColumn(col, 1);
+               uiLayoutSetActive(sub, RNA_boolean_get(&spaceptr, "show_cursor")); 
+                       row= uiLayoutSplit(sub, 0.7, 1);
                                uiItemR(row, &sceneptr, "frame_current", 0, "Cursor X", ICON_NONE);
                                uiItemEnumO(row, "GRAPH_OT_snap", "To Keys", 0, "type", GRAPHKEYS_SNAP_CFRA);
-                       row= uiLayoutSplit(subcol, 0.7, 1);
+                       row= uiLayoutSplit(sub, 0.7, 1);
                                uiItemR(row, &spaceptr, "cursor_position_y", 0, "Cursor Y", ICON_NONE);
                                uiItemEnumO(row, "GRAPH_OT_snap", "To Keys", 0, "type", GRAPHKEYS_SNAP_VALUE);
 }
@@ -168,7 +168,7 @@ static void graph_panel_properties(const bContext *C, Panel *pa)
        FCurve *fcu;
        PointerRNA fcu_ptr;
        uiLayout *layout = pa->layout;
-       uiLayout *col, *row, *subrow;
+       uiLayout *col, *row, *sub;
        uiBlock *block;
        char name[256];
        int icon = 0;
@@ -201,9 +201,9 @@ static void graph_panel_properties(const bContext *C, Panel *pa)
                row= uiLayoutRow(col, 1);
                        uiItemR(row, &fcu_ptr, "color_mode", 0, "", ICON_NONE);
                        
-                       subrow= uiLayoutRow(row, 1);
-                               uiLayoutSetEnabled(subrow, (fcu->color_mode==FCURVE_COLOR_CUSTOM));
-                               uiItemR(subrow, &fcu_ptr, "color", 0, "", ICON_NONE);
+                       sub= uiLayoutRow(row, 1);
+                               uiLayoutSetEnabled(sub, (fcu->color_mode==FCURVE_COLOR_CUSTOM));
+                               uiItemR(sub, &fcu_ptr, "color", 0, "", ICON_NONE);
        
        MEM_freeN(ale);
 }
@@ -562,7 +562,7 @@ static void graph_panel_driverVar__transChan(uiLayout *layout, ID *id, DriverVar
        DriverTarget *dtar= &dvar->targets[0];
        Object *ob = (Object *)dtar->id;
        PointerRNA dtar_ptr;
-       uiLayout *col, *subcol;
+       uiLayout *col, *sub;
        
        /* initialise RNA pointer to the target */
        RNA_pointer_create(id, &RNA_DriverTarget, dtar, &dtar_ptr); 
@@ -578,9 +578,9 @@ static void graph_panel_driverVar__transChan(uiLayout *layout, ID *id, DriverVar
                        uiItemPointerR(col, &dtar_ptr, "bone_target", &tar_ptr, "bones", "", ICON_BONE_DATA);
                }
                
-               subcol= uiLayoutColumn(layout, 1);
-                       uiItemR(subcol, &dtar_ptr, "transform_type", 0, NULL, ICON_NONE);
-                       uiItemR(subcol, &dtar_ptr, "transform_space", 0, "Space", ICON_NONE);
+               sub= uiLayoutColumn(layout, 1);
+                       uiItemR(sub, &dtar_ptr, "transform_type", 0, NULL, ICON_NONE);
+                       uiItemR(sub, &dtar_ptr, "transform_space", 0, "Space", ICON_NONE);
 }
 
 /* driver settings for active F-Curve (only for 'Drivers' mode) */
index 71cfa5128af19a4cb989917ff6cfc37b1058285e..6c68ba0ea71805ce35d3ab6402fc9484b0c9a8b5 100644 (file)
@@ -791,16 +791,15 @@ void uiTemplateImageSettings(uiLayout *layout, PointerRNA *imfptr)
        /* some settings depend on this being a scene thats rendered */
        const short is_render_out= (id && GS(id->name) == ID_SCE);
 
-       uiLayout *col, *row, *colsub, *rowsub;
+       uiLayout *col, *row, *split, *sub;
 
        col= uiLayoutColumn(layout, 0);
 
-       row= uiLayoutSplit(col, 0.5f, 0);
-       colsub= uiLayoutColumn(row, 0);
-       uiItemR(colsub, imfptr, "file_format", 0, "", ICON_NONE);
-       colsub= uiLayoutColumn(row, 0);
-       rowsub= uiLayoutRow(colsub, 0);
-       uiItemR(rowsub, imfptr, "color_mode", UI_ITEM_R_EXPAND, "Color", ICON_NONE);
+       split= uiLayoutSplit(col, 0.5f, 0);
+       
+       uiItemR(split, imfptr, "file_format", 0, "", ICON_NONE);
+       sub= uiLayoutRow(split, 0);
+       uiItemR(sub, imfptr, "color_mode", UI_ITEM_R_EXPAND, "Color", ICON_NONE);
 
        /* only display depth setting if multiple depths can be used */
        if((ELEM6(depth_ok,
index 2f69fc5f99f67caf3646da5d8e464584da55427b..a6e5506f98dd98990c3fb4ea8a5d9ec6a497d62f 100644 (file)
@@ -3222,7 +3222,7 @@ static int is_sensor_linked(uiBlock *block, bSensor *sens)
 
 static void draw_sensor_header(uiLayout *layout, PointerRNA *ptr, PointerRNA *logic_ptr)
 {
-       uiLayout *box, *row, *subrow;
+       uiLayout *box, *row, *sub;
        bSensor *sens= (bSensor *)ptr->data;
        
        box= uiLayoutBox(layout);
@@ -3237,15 +3237,15 @@ static void draw_sensor_header(uiLayout *layout, PointerRNA *ptr, PointerRNA *lo
                uiItemL(row, sens->name, ICON_NONE);
        }
 
-       subrow= uiLayoutRow(row, 0);
-       uiLayoutSetActive(subrow, ((RNA_boolean_get(logic_ptr, "show_sensors_active_states")
+       sub= uiLayoutRow(row, 0);
+       uiLayoutSetActive(sub, ((RNA_boolean_get(logic_ptr, "show_sensors_active_states")
                                                        && RNA_boolean_get(ptr, "show_expanded")) || RNA_boolean_get(ptr, "pin")));
-       uiItemR(subrow, ptr, "pin", UI_ITEM_R_NO_BG, "", ICON_NONE);
+       uiItemR(sub, ptr, "pin", UI_ITEM_R_NO_BG, "", ICON_NONE);
 
        if(RNA_boolean_get(ptr, "show_expanded")==0) {
-               subrow= uiLayoutRow(row, 1);
-               uiItemEnumO(subrow, "LOGIC_OT_sensor_move", "", ICON_TRIA_UP, "direction", 1); // up
-               uiItemEnumO(subrow, "LOGIC_OT_sensor_move", "", ICON_TRIA_DOWN, "direction", 2); // down
+               sub= uiLayoutRow(row, 1);
+               uiItemEnumO(sub, "LOGIC_OT_sensor_move", "", ICON_TRIA_UP, "direction", 1); // up
+               uiItemEnumO(sub, "LOGIC_OT_sensor_move", "", ICON_TRIA_DOWN, "direction", 2); // down
        }
 
        uiItemO(row, "", ICON_X, "LOGIC_OT_sensor_remove");
@@ -3253,7 +3253,7 @@ static void draw_sensor_header(uiLayout *layout, PointerRNA *ptr, PointerRNA *lo
 
 static void draw_sensor_internal_header(uiLayout *layout, PointerRNA *ptr)
 {
-       uiLayout *box, *split, *subrow, *row;
+       uiLayout *box, *split, *sub, *row;
 
        box= uiLayoutBox(layout);
        split = uiLayoutSplit(box, 0.45, 0);
@@ -3262,17 +3262,16 @@ static void draw_sensor_internal_header(uiLayout *layout, PointerRNA *ptr)
        uiItemR(row, ptr, "use_pulse_true_level", 0, "", ICON_DOTSUP);
        uiItemR(row, ptr, "use_pulse_false_level", 0, "", ICON_DOTSDOWN);
 
-       subrow=uiLayoutRow(row, 0);
-       uiLayoutSetActive(subrow, (RNA_boolean_get(ptr, "use_pulse_true_level")
+       sub=uiLayoutRow(row, 0);
+       uiLayoutSetActive(sub, (RNA_boolean_get(ptr, "use_pulse_true_level")
                                                        || RNA_boolean_get(ptr, "use_pulse_false_level")));
-       uiItemR(subrow, ptr, "frequency", 0, "Freq", ICON_NONE);
+       uiItemR(sub, ptr, "frequency", 0, "Freq", ICON_NONE);
        
        row= uiLayoutRow(split, 1);
        uiItemR(row, ptr, "use_level", UI_ITEM_R_TOGGLE, NULL, ICON_NONE);
        uiItemR(row, ptr, "use_tap", UI_ITEM_R_TOGGLE, NULL, ICON_NONE);
        
-       row= uiLayoutRow(split, 1);
-       uiItemR(row, ptr, "invert", UI_ITEM_R_TOGGLE, "Invert", ICON_NONE);
+       uiItemR(split, ptr, "invert", UI_ITEM_R_TOGGLE, "Invert", ICON_NONE);
 }
 /* sensors in alphabetical order */
 
@@ -3577,7 +3576,7 @@ static void draw_brick_sensor(uiLayout *layout, PointerRNA *ptr, bContext *C)
 /* Controller code */
 static void draw_controller_header(uiLayout *layout, PointerRNA *ptr, int xco, int width, int yco)
 {
-       uiLayout *box, *row, *subrow;
+       uiLayout *box, *row, *sub;
        bController *cont= (bController *)ptr->data;
 
        char state[3];
@@ -3601,9 +3600,9 @@ static void draw_controller_header(uiLayout *layout, PointerRNA *ptr, int xco, i
        uiItemR(row, ptr, "use_priority", 0, "", ICON_NONE);
 
        if(RNA_boolean_get(ptr, "show_expanded")==0) {
-               subrow= uiLayoutRow(row, 1);
-               uiItemEnumO(subrow, "LOGIC_OT_controller_move", "", ICON_TRIA_UP, "direction", 1); // up
-               uiItemEnumO(subrow, "LOGIC_OT_controller_move", "", ICON_TRIA_DOWN, "direction", 2); // down
+               sub= uiLayoutRow(row, 1);
+               uiItemEnumO(sub, "LOGIC_OT_controller_move", "", ICON_TRIA_UP, "direction", 1); // up
+               uiItemEnumO(sub, "LOGIC_OT_controller_move", "", ICON_TRIA_DOWN, "direction", 2); // down
        }
        uiItemO(row, "", ICON_X, "LOGIC_OT_controller_remove");
 }
@@ -3615,7 +3614,7 @@ static void draw_controller_expression(uiLayout *layout, PointerRNA *ptr)
 
 static void draw_controller_python(uiLayout *layout, PointerRNA *ptr)
 {
-       uiLayout *split, *subsplit;
+       uiLayout *split, *sub;
 
        split = uiLayoutSplit(layout, 0.3, 1);
        uiItemR(split, ptr, "mode", 0, "", ICON_NONE);
@@ -3623,9 +3622,9 @@ static void draw_controller_python(uiLayout *layout, PointerRNA *ptr)
                uiItemR(split, ptr, "text", 0, "", ICON_NONE);
        }
        else {
-               subsplit = uiLayoutSplit(split, 0.8, 0);
-               uiItemR(subsplit, ptr, "module", 0, "", ICON_NONE);
-               uiItemR(subsplit, ptr, "use_debug", UI_ITEM_R_TOGGLE, NULL, ICON_NONE);
+               sub = uiLayoutSplit(split, 0.8, 0);
+               uiItemR(sub, ptr, "module", 0, "", ICON_NONE);
+               uiItemR(sub, ptr, "use_debug", UI_ITEM_R_TOGGLE, NULL, ICON_NONE);
        }
 }
 
@@ -3670,7 +3669,7 @@ static void draw_brick_controller(uiLayout *layout, PointerRNA *ptr)
 /* Actuator code */
 static void draw_actuator_header(uiLayout *layout, PointerRNA *ptr, PointerRNA *logic_ptr)
 {
-       uiLayout *box, *row, *subrow;
+       uiLayout *box, *row, *sub;
        bActuator *act= (bActuator *)ptr->data;
        
        box= uiLayoutBox(layout);
@@ -3685,15 +3684,15 @@ static void draw_actuator_header(uiLayout *layout, PointerRNA *ptr, PointerRNA *
                uiItemL(row, act->name, ICON_NONE);
        }
 
-       subrow= uiLayoutRow(row, 0);
-       uiLayoutSetActive(subrow, ((RNA_boolean_get(logic_ptr, "show_actuators_active_states")
+       sub= uiLayoutRow(row, 0);
+       uiLayoutSetActive(sub, ((RNA_boolean_get(logic_ptr, "show_actuators_active_states")
                                                        && RNA_boolean_get(ptr, "show_expanded")) || RNA_boolean_get(ptr, "pin")));
-       uiItemR(subrow, ptr, "pin", UI_ITEM_R_NO_BG, "", ICON_NONE);
+       uiItemR(sub, ptr, "pin", UI_ITEM_R_NO_BG, "", ICON_NONE);
 
        if(RNA_boolean_get(ptr, "show_expanded")==0) {
-               subrow= uiLayoutRow(row, 1);
-               uiItemEnumO(subrow, "LOGIC_OT_actuator_move", "", ICON_TRIA_UP, "direction", 1); // up
-               uiItemEnumO(subrow, "LOGIC_OT_actuator_move", "", ICON_TRIA_DOWN, "direction", 2); // down
+               sub= uiLayoutRow(row, 1);
+               uiItemEnumO(sub, "LOGIC_OT_actuator_move", "", ICON_TRIA_UP, "direction", 1); // up
+               uiItemEnumO(sub, "LOGIC_OT_actuator_move", "", ICON_TRIA_DOWN, "direction", 2); // down
        }
        uiItemO(row, "", ICON_X, "LOGIC_OT_actuator_remove");
 }
@@ -3702,20 +3701,20 @@ static void draw_actuator_action(uiLayout *layout, PointerRNA *ptr)
 {
        Object *ob = (Object *)ptr->id.data;
        PointerRNA settings_ptr;
-       uiLayout *row, *subrow, *col;
+       uiLayout *row, *sub, *col;
 
        RNA_pointer_create((ID *)ob, &RNA_GameObjectSettings, ob, &settings_ptr);
 
        row= uiLayoutRow(layout, 0);
        uiItemR(row, ptr, "play_mode", 0, "", ICON_NONE);
 
-       subrow= uiLayoutRow(row, 1);
-       uiItemR(subrow, ptr, "use_force", UI_ITEM_R_TOGGLE, NULL, ICON_NONE);
-       uiItemR(subrow, ptr, "use_additive", UI_ITEM_R_TOGGLE, NULL, ICON_NONE);
+       sub= uiLayoutRow(row, 1);
+       uiItemR(sub, ptr, "use_force", UI_ITEM_R_TOGGLE, NULL, ICON_NONE);
+       uiItemR(sub, ptr, "use_additive", UI_ITEM_R_TOGGLE, NULL, ICON_NONE);
 
-       col = uiLayoutColumn(subrow, 0);
-       uiLayoutSetActive(col, (RNA_boolean_get(ptr, "use_additive") || RNA_boolean_get(ptr, "use_force")));
-       uiItemR(col, ptr, "use_local", UI_ITEM_R_TOGGLE, NULL, ICON_NONE);
+       row = uiLayoutColumn(sub, 0);
+       uiLayoutSetActive(row, (RNA_boolean_get(ptr, "use_additive") || RNA_boolean_get(ptr, "use_force")));
+       uiItemR(row, ptr, "use_local", UI_ITEM_R_TOGGLE, NULL, ICON_NONE);
 
        row= uiLayoutRow(layout, 0);
        uiItemR(row, ptr, "action", 0, "", ICON_NONE);
@@ -3740,11 +3739,10 @@ static void draw_actuator_action(uiLayout *layout, PointerRNA *ptr)
        uiItemR(row, ptr, "layer", 0, NULL, ICON_NONE);
        uiItemR(row, ptr, "layer_weight", 0, NULL, ICON_NONE);
 
-       row= uiLayoutRow(layout, 0);
        uiItemPointerR(layout, ptr, "frame_property", &settings_ptr, "properties", NULL, ICON_NONE);
 
 #ifdef __NLA_ACTION_BY_MOTION_ACTUATOR
-       uiItemR(row, "stride_length", 0, NULL, ICON_NONE);
+       uiItemR(layout, "stride_length", 0, NULL, ICON_NONE);
 #endif
 }
 
@@ -3829,7 +3827,7 @@ static void draw_actuator_camera(uiLayout *layout, PointerRNA *ptr)
 
 static void draw_actuator_constraint(uiLayout *layout, PointerRNA *ptr, bContext *C)
 {
-       uiLayout *row, *col, *subcol, *split;
+       uiLayout *row, *col, *sub, *split;
        PointerRNA main_ptr;
 
        RNA_main_pointer_create(CTX_data_main(C), &main_ptr);
@@ -3855,15 +3853,15 @@ static void draw_actuator_constraint(uiLayout *layout, PointerRNA *ptr, bContext
                        uiItemR(row, ptr, "use_normal", UI_ITEM_R_TOGGLE, NULL, ICON_NONE);
 
                        row = uiLayoutRow(layout, 0);
-                       col = uiLayoutColumn(row, 0);
+                       col = uiLayoutColumn(row, 1);
                        uiItemL(col, "Range:", ICON_NONE);
                        uiItemR(col, ptr, "range", 0, "", ICON_NONE);
 
                        col = uiLayoutColumn(row, 1);
                        uiItemR(col, ptr, "use_force_distance", UI_ITEM_R_TOGGLE, NULL, ICON_NONE);
-                       subcol = uiLayoutColumn(col, 0);
-                       uiLayoutSetActive(subcol, RNA_boolean_get(ptr, "use_force_distance")==1);
-                       uiItemR(subcol, ptr, "distance", 0, "", ICON_NONE);
+                       sub = uiLayoutColumn(col, 0);
+                       uiLayoutSetActive(sub, RNA_boolean_get(ptr, "use_force_distance")==1);
+                       uiItemR(sub, ptr, "distance", 0, "", ICON_NONE);
 
                        uiItemR(layout, ptr, "damping", UI_ITEM_R_SLIDER , NULL, ICON_NONE);
 
@@ -3931,7 +3929,7 @@ static void draw_actuator_constraint(uiLayout *layout, PointerRNA *ptr, bContext
 static void draw_actuator_edit_object(uiLayout *layout, PointerRNA *ptr)
 {
        Object *ob = (Object *)ptr->id.data;
-       uiLayout *row, *split, *subsplit;
+       uiLayout *row, *split, *sub;
        uiItemR(layout, ptr, "mode", 0, NULL, ICON_NONE);
 
        switch (RNA_enum_get(ptr, "mode"))
@@ -3967,9 +3965,9 @@ static void draw_actuator_edit_object(uiLayout *layout, PointerRNA *ptr)
                case ACT_EDOB_TRACK_TO:
                        split = uiLayoutSplit(layout, 0.5, 0);
                        uiItemR(split, ptr, "track_object", 0, NULL, ICON_NONE);
-                       subsplit = uiLayoutSplit(split, 0.7, 0);
-                       uiItemR(subsplit, ptr, "time", 0, NULL, ICON_NONE);
-                       uiItemR(subsplit, ptr, "use_3d_tracking", UI_ITEM_R_TOGGLE, NULL, ICON_NONE);
+                       sub = uiLayoutSplit(split, 0.7, 0);
+                       uiItemR(sub, ptr, "time", 0, NULL, ICON_NONE);
+                       uiItemR(sub, ptr, "use_3d_tracking", UI_ITEM_R_TOGGLE, NULL, ICON_NONE);
                        break;
                case ACT_EDOB_DYNAMICS:
                        if(ob->type != OB_MESH) {
@@ -4041,7 +4039,7 @@ static void draw_actuator_motion(uiLayout *layout, PointerRNA *ptr)
 {
        Object *ob;
        PointerRNA settings_ptr;
-       uiLayout *split, *row, *col, *subcol;
+       uiLayout *split, *row, *col, *sub;
        int physics_type;
 
        ob = (Object *)ptr->id.data;    
@@ -4100,24 +4098,24 @@ static void draw_actuator_motion(uiLayout *layout, PointerRNA *ptr)
                        row = uiLayoutRow(layout, 0);
                        col = uiLayoutColumn(row, 0);
                        uiItemR(col, ptr, "use_servo_limit_x", UI_ITEM_R_TOGGLE, NULL, ICON_NONE);
-                       subcol = uiLayoutColumn(col, 1);
-                       uiLayoutSetActive(subcol, RNA_boolean_get(ptr, "use_servo_limit_x")==1);
-                       uiItemR(subcol, ptr, "force_max_x", 0, NULL, ICON_NONE);
-                       uiItemR(subcol, ptr, "force_min_x", 0, NULL, ICON_NONE);
+                       sub = uiLayoutColumn(col, 1);
+                       uiLayoutSetActive(sub, RNA_boolean_get(ptr, "use_servo_limit_x")==1);
+                       uiItemR(sub, ptr, "force_max_x", 0, NULL, ICON_NONE);
+                       uiItemR(sub, ptr, "force_min_x", 0, NULL, ICON_NONE);
 
                        col = uiLayoutColumn(row, 0);
                        uiItemR(col, ptr, "use_servo_limit_y", UI_ITEM_R_TOGGLE, NULL, ICON_NONE);
-                       subcol = uiLayoutColumn(col, 1);
-                       uiLayoutSetActive(subcol, RNA_boolean_get(ptr, "use_servo_limit_y")==1);
-                       uiItemR(subcol, ptr, "force_max_y", 0, NULL, ICON_NONE);
-                       uiItemR(subcol, ptr, "force_min_y", 0, NULL, ICON_NONE);
+                       sub = uiLayoutColumn(col, 1);
+                       uiLayoutSetActive(sub, RNA_boolean_get(ptr, "use_servo_limit_y")==1);
+                       uiItemR(sub, ptr, "force_max_y", 0, NULL, ICON_NONE);
+                       uiItemR(sub, ptr, "force_min_y", 0, NULL, ICON_NONE);
 
                        col = uiLayoutColumn(row, 0);
                        uiItemR(col, ptr, "use_servo_limit_z", UI_ITEM_R_TOGGLE, NULL, ICON_NONE);
-                       subcol = uiLayoutColumn(col, 1);
-                       uiLayoutSetActive(subcol, RNA_boolean_get(ptr, "use_servo_limit_z")==1);
-                       uiItemR(subcol, ptr, "force_max_z", 0, NULL, ICON_NONE);
-                       uiItemR(subcol, ptr, "force_min_z", 0, NULL, ICON_NONE);
+                       sub = uiLayoutColumn(col, 1);
+                       uiLayoutSetActive(sub, RNA_boolean_get(ptr, "use_servo_limit_z")==1);
+                       uiItemR(sub, ptr, "force_max_z", 0, NULL, ICON_NONE);
+                       uiItemR(sub, ptr, "force_min_z", 0, NULL, ICON_NONE);
 
                        //XXXACTUATOR missing labels from original 2.49 ui (e.g. Servo, Min, Max, Fast)
                        //Layout designers willing to help on that, please compare with 2.49 ui
@@ -4133,7 +4131,7 @@ static void draw_actuator_motion(uiLayout *layout, PointerRNA *ptr)
 
 static void draw_actuator_parent(uiLayout *layout, PointerRNA *ptr)
 {
-       uiLayout *row, *subrow;
+       uiLayout *row, *sub;
 
        uiItemR(layout, ptr, "mode", 0, NULL, ICON_NONE);
 
@@ -4142,9 +4140,9 @@ static void draw_actuator_parent(uiLayout *layout, PointerRNA *ptr)
 
                row = uiLayoutRow(layout, 0);
                uiItemR(row, ptr, "use_compound", 0, NULL, ICON_NONE);
-               subrow= uiLayoutRow(row, 0);
-               uiLayoutSetActive(subrow, RNA_boolean_get(ptr, "use_compound")==1);
-               uiItemR(subrow, ptr, "use_ghost", 0, NULL, ICON_NONE);
+               sub= uiLayoutRow(row, 0);
+               uiLayoutSetActive(sub, RNA_boolean_get(ptr, "use_compound")==1);
+               uiItemR(sub, ptr, "use_ghost", 0, NULL, ICON_NONE);
        }
 }
 
@@ -4156,7 +4154,7 @@ static void draw_actuator_property(uiLayout *layout, PointerRNA *ptr)
        Object *ob_from= pa->ob;
        PointerRNA settings_ptr, obj_settings_ptr;
 
-       uiLayout *row, *subrow;
+       uiLayout *row, *sub;
 
        RNA_pointer_create((ID *)ob, &RNA_GameObjectSettings, ob, &settings_ptr);
 
@@ -4181,9 +4179,9 @@ static void draw_actuator_property(uiLayout *layout, PointerRNA *ptr)
                                uiItemPointerR(row, ptr, "object_property", &obj_settings_ptr, "properties", NULL, ICON_NONE);
                        }else
                        {
-                               subrow= uiLayoutRow(row, 0);
-                               uiLayoutSetActive(subrow, 0);
-                               uiItemR(subrow, ptr, "object_property", 0, NULL, ICON_NONE);
+                               sub= uiLayoutRow(row, 0);
+                               uiLayoutSetActive(sub, 0);
+                               uiItemR(sub, ptr, "object_property", 0, NULL, ICON_NONE);
                        }
                        break;
        }
index 7ba33e7e57e629fa73fa08ab8ee03c02127bccb8..79d11c956cdc1f32d444a264563741ec7186b8ae 100644 (file)
@@ -294,7 +294,7 @@ static void nla_panel_properties(const bContext *C, Panel *pa)
 {
        PointerRNA strip_ptr;
        uiLayout *layout= pa->layout;
-       uiLayout *column, *row, *subcol;
+       uiLayout *column, *row, *sub;
        uiBlock *block;
        short showEvalProps = 1;
        
@@ -339,10 +339,10 @@ static void nla_panel_properties(const bContext *C, Panel *pa)
                        uiLayoutSetActive(column, RNA_boolean_get(&strip_ptr, "use_animated_influence")==0); 
                        uiItemR(column, &strip_ptr, "use_auto_blend", 0, NULL, ICON_NONE); // XXX as toggle?
                        
-                       subcol= uiLayoutColumn(column, 1);
-                               uiLayoutSetActive(subcol, RNA_boolean_get(&strip_ptr, "use_auto_blend")==0); 
-                               uiItemR(subcol, &strip_ptr, "blend_in", 0, NULL, ICON_NONE);
-                               uiItemR(subcol, &strip_ptr, "blend_out", 0, NULL, ICON_NONE);
+                       sub= uiLayoutColumn(column, 1);
+                               uiLayoutSetActive(sub, RNA_boolean_get(&strip_ptr, "use_auto_blend")==0); 
+                               uiItemR(sub, &strip_ptr, "blend_in", 0, NULL, ICON_NONE);
+                               uiItemR(sub, &strip_ptr, "blend_out", 0, NULL, ICON_NONE);
                        
                /* settings */
                column= uiLayoutColumn(layout, 1);
@@ -395,7 +395,7 @@ static void nla_panel_evaluation(const bContext *C, Panel *pa)
 {
        PointerRNA strip_ptr;
        uiLayout *layout= pa->layout;
-       uiLayout *column, *subcolumn, *subrow;
+       uiLayout *col, *sub;
        uiBlock *block;
 
        /* check context and also validity of pointer */
@@ -405,23 +405,21 @@ static void nla_panel_evaluation(const bContext *C, Panel *pa)
        block= uiLayoutGetBlock(layout);
        uiBlockSetHandleFunc(block, do_nla_region_buttons, NULL);
                
-       column= uiLayoutColumn(layout, 1);
-               uiItemR(column, &strip_ptr, "use_animated_influence", 0, NULL, ICON_NONE);
-               
-               subcolumn= uiLayoutColumn(column, 1);
-               uiLayoutSetEnabled(subcolumn, RNA_boolean_get(&strip_ptr, "use_animated_influence"));   
-                       uiItemR(subcolumn, &strip_ptr, "influence", 0, NULL, ICON_NONE);
-               
+       col= uiLayoutColumn(layout, 1);
+       uiItemR(col, &strip_ptr, "use_animated_influence", 0, NULL, ICON_NONE);
        
-       column= uiLayoutColumn(layout, 1);
-               subrow= uiLayoutRow(column, 0);
-               uiItemR(subrow, &strip_ptr, "use_animated_time", 0, NULL, ICON_NONE);
-               uiItemR(subrow, &strip_ptr, "use_animated_time_cyclic", 0, NULL, ICON_NONE);
-
-               subcolumn= uiLayoutColumn(column, 1);
-               subrow= uiLayoutRow(subcolumn, 0);
-               uiLayoutSetEnabled(subrow, RNA_boolean_get(&strip_ptr, "use_animated_time"));
-                       uiItemR(subcolumn, &strip_ptr, "strip_time", 0, NULL, ICON_NONE);
+       sub= uiLayoutColumn(col, 1);
+       uiLayoutSetEnabled(sub, RNA_boolean_get(&strip_ptr, "use_animated_influence")); 
+       uiItemR(sub, &strip_ptr, "influence", 0, NULL, ICON_NONE);
+
+       col= uiLayoutColumn(layout, 1);
+       sub= uiLayoutRow(col, 0);
+       uiItemR(sub, &strip_ptr, "use_animated_time", 0, NULL, ICON_NONE);
+       uiItemR(sub, &strip_ptr, "use_animated_time_cyclic", 0, NULL, ICON_NONE);
+
+       sub= uiLayoutRow(col, 0);
+       uiLayoutSetEnabled(sub, RNA_boolean_get(&strip_ptr, "use_animated_time"));
+       uiItemR(sub, &strip_ptr, "strip_time", 0, NULL, ICON_NONE);
 }
 
 /* F-Modifiers for active NLA-Strip */