[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [33602] trunk/blender/source/blender/ editors/interface: 2.4 feature back:

Ton Roosendaal ton at blender.org
Sat Dec 11 18:47:36 CET 2010


Revision: 33602
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=33602
Author:   ton
Date:     2010-12-11 18:47:36 +0100 (Sat, 11 Dec 2010)

Log Message:
-----------
2.4 feature back:

For constraints that have 'disabled' flag (because it has invalid
input) the name was drawn in red. Easy to recognize constraints that
stopped working.

Modified Paths:
--------------
    trunk/blender/source/blender/editors/interface/interface_layout.c
    trunk/blender/source/blender/editors/interface/interface_templates.c

Modified: trunk/blender/source/blender/editors/interface/interface_layout.c
===================================================================
--- trunk/blender/source/blender/editors/interface/interface_layout.c	2010-12-11 16:35:11 UTC (rev 33601)
+++ trunk/blender/source/blender/editors/interface/interface_layout.c	2010-12-11 17:47:36 UTC (rev 33602)
@@ -961,6 +961,9 @@
 	else if(type == PROP_ENUM || type == PROP_STRING || type == PROP_POINTER) {
 		but= ui_item_with_label(layout, block, name, icon, ptr, prop, index, 0, 0, w, h, flag);
 		ui_but_add_search(but, ptr, prop, NULL, NULL);
+		
+		if(layout->redalert)
+			uiButSetFlag(but, UI_BUT_REDALERT);
 	}
 	/* single button */
 	else {
@@ -971,6 +974,9 @@
 
 		if(toggle && but->type==OPTION)
 			but->type= TOG;
+		
+		if(layout->redalert)
+			uiButSetFlag(but, UI_BUT_REDALERT);
 	}
 	
 	if (no_bg)

Modified: trunk/blender/source/blender/editors/interface/interface_templates.c
===================================================================
--- trunk/blender/source/blender/editors/interface/interface_templates.c	2010-12-11 16:35:11 UTC (rev 33601)
+++ trunk/blender/source/blender/editors/interface/interface_templates.c	2010-12-11 17:47:36 UTC (rev 33602)
@@ -833,9 +833,6 @@
 	
 	switch(event) {
 	case B_CONSTRAINT_TEST:
-		// XXX allqueue(REDRAWVIEW3D, 0);
-		// XXX allqueue(REDRAWBUTSOBJECT, 0);
-		// XXX allqueue(REDRAWBUTSEDIT, 0);
 		break;  // no handling
 	case B_CONSTRAINT_CHANGETARGET:
 		if (ob->pose) ob->pose->flag |= POSE_RECALC;	// checks & sorts pose channels
@@ -855,10 +852,6 @@
 	else DAG_id_tag_update(&ob->id, OB_RECALC_OB);
 
 	WM_event_add_notifier(C, NC_OBJECT|ND_CONSTRAINT, ob);
-	
-	// XXX allqueue(REDRAWVIEW3D, 0);
-	// XXX allqueue(REDRAWBUTSOBJECT, 0);
-	// XXX allqueue(REDRAWBUTSEDIT, 0);
 }
 
 static void constraint_active_func(bContext *UNUSED(C), void *ob_v, void *con_v)
@@ -920,18 +913,20 @@
 	uiItemR(row, &ptr, "show_expanded", UI_ITEM_R_ICON_ONLY, "", 0);
 	uiBlockSetEmboss(block, UI_EMBOSS);
 	
-	/* XXX if (con->flag & CONSTRAINT_DISABLE)
-		uiBlockSetCol(block, TH_REDALERT);*/
-	
 	/* name */
 	uiDefBut(block, LABEL, B_CONSTRAINT_TEST, typestr, xco+10, yco, 100, 18, NULL, 0.0, 0.0, 0.0, 0.0, ""); 
 
+	if (con->flag & CONSTRAINT_DISABLE)
+		uiLayoutSetRedAlert(row, 1);
+	
 	if(proxy_protected == 0) {
 		uiItemR(row, &ptr, "name", 0, "", 0);
 	}
 	else
 		uiItemL(row, con->name, 0);
 	
+	uiLayoutSetRedAlert(row, 0);
+	
 	/* proxy-protected constraints cannot be edited, so hide up/down + close buttons */
 	if (proxy_protected) {
 		uiBlockSetEmboss(block, UI_EMBOSSN);
@@ -1001,7 +996,7 @@
 		box= uiLayoutBox(col);
 		block= uiLayoutAbsoluteBlock(box);
 		result= box;
-		}
+	}
 
 	/* clear any locks set up for proxies/lib-linking */
 	uiBlockClearButLock(block);





More information about the Bf-blender-cvs mailing list