[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [42104] trunk/blender/source/blender/ editors: 2.6 UI code:

Thomas Dinges blender at dingto.org
Wed Nov 23 20:05:52 CET 2011


Revision: 42104
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=42104
Author:   dingto
Date:     2011-11-23 19:05:52 +0000 (Wed, 23 Nov 2011)
Log Message:
-----------
2.6 UI code:
* 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. 

Modified Paths:
--------------
    trunk/blender/source/blender/editors/animation/fmodifier_ui.c
    trunk/blender/source/blender/editors/gpencil/gpencil_buttons.c
    trunk/blender/source/blender/editors/space_graph/graph_buttons.c
    trunk/blender/source/blender/editors/space_image/image_buttons.c
    trunk/blender/source/blender/editors/space_logic/logic_window.c
    trunk/blender/source/blender/editors/space_nla/nla_buttons.c

Modified: trunk/blender/source/blender/editors/animation/fmodifier_ui.c
===================================================================
--- trunk/blender/source/blender/editors/animation/fmodifier_ui.c	2011-11-23 18:53:49 UTC (rev 42103)
+++ trunk/blender/source/blender/editors/animation/fmodifier_ui.c	2011-11-23 19:05:52 UTC (rev 42104)
@@ -569,7 +569,7 @@
 /* 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 @@
 	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 @@
 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 @@
 		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);
 		

Modified: trunk/blender/source/blender/editors/gpencil/gpencil_buttons.c
===================================================================
--- trunk/blender/source/blender/editors/gpencil/gpencil_buttons.c	2011-11-23 18:53:49 UTC (rev 42103)
+++ trunk/blender/source/blender/editors/gpencil/gpencil_buttons.c	2011-11-23 19:05:52 UTC (rev 42104)
@@ -95,8 +95,8 @@
 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 @@
 	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 @@
 		
 		/* 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 @@
 			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 @@
 	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 @@
 		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);
 		}
 		
 	}

Modified: trunk/blender/source/blender/editors/space_graph/graph_buttons.c
===================================================================
--- trunk/blender/source/blender/editors/space_graph/graph_buttons.c	2011-11-23 18:53:49 UTC (rev 42103)
+++ trunk/blender/source/blender/editors/space_graph/graph_buttons.c	2011-11-23 19:05:52 UTC (rev 42104)
@@ -136,7 +136,7 @@
 	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 @@
 	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);

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list