[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [13365] trunk/blender/source/blender/src/ buttons_object.c: Constraints GUI:

Joshua Leung aligorith at gmail.com
Wed Jan 23 11:54:10 CET 2008


Revision: 13365
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=13365
Author:   aligorith
Date:     2008-01-23 11:54:10 +0100 (Wed, 23 Jan 2008)

Log Message:
-----------
Constraints GUI:
Up/Down buttons which are disabled are now always drawn, but those that are disabled (cannot be done) now have their 'button backgrounds' not drawn. Also, they won't do anything when clicked.

Modified Paths:
--------------
    trunk/blender/source/blender/src/buttons_object.c

Modified: trunk/blender/source/blender/src/buttons_object.c
===================================================================
--- trunk/blender/source/blender/src/buttons_object.c	2008-01-23 10:14:45 UTC (rev 13364)
+++ trunk/blender/source/blender/src/buttons_object.c	2008-01-23 10:54:10 UTC (rev 13365)
@@ -602,13 +602,27 @@
 		uiBlockBeginAlign(block);
 			uiBlockSetEmboss(block, UI_EMBOSS);
 			
-			if (prev_proxylock == 0) {
+			if ((prev_proxylock) || (con->prev==NULL)) {
+				/* don't draw 'button' behind arrow if disabled (and button doesn't do anything anyways) */
+				uiBlockSetEmboss(block, UI_EMBOSSN);
+				uiDefIconBut(block, BUT, B_CONSTRAINT_TEST, VICON_MOVE_UP, *xco+width-50, *yco, 16, 18, NULL, 0.0, 0.0, 0.0, 0.0, "Move constraint up in constraint stack");
+				uiBlockSetEmboss(block, UI_EMBOSS);
+			}
+			else {
 				but = uiDefIconBut(block, BUT, B_CONSTRAINT_TEST, VICON_MOVE_UP, *xco+width-50, *yco, 16, 18, NULL, 0.0, 0.0, 0.0, 0.0, "Move constraint up in constraint stack");
 				uiButSetFunc(but, constraint_moveUp, ob, con);
 			}
 			
-			but = uiDefIconBut(block, BUT, B_CONSTRAINT_TEST, VICON_MOVE_DOWN, *xco+width-50+18, *yco, 16, 18, NULL, 0.0, 0.0, 0.0, 0.0, "Move constraint down in constraint stack");
-			uiButSetFunc(but, constraint_moveDown, ob, con);
+			if (con->next) {
+				but = uiDefIconBut(block, BUT, B_CONSTRAINT_TEST, VICON_MOVE_DOWN, *xco+width-50+18, *yco, 16, 18, NULL, 0.0, 0.0, 0.0, 0.0, "Move constraint down in constraint stack");
+				uiButSetFunc(but, constraint_moveDown, ob, con);
+			}
+			else {
+				/* don't draw 'button' behind arrow if no next constraint (it doesn't do anything anyways) */
+				uiBlockSetEmboss(block, UI_EMBOSSN);
+				uiDefIconBut(block, BUT, B_CONSTRAINT_TEST, VICON_MOVE_DOWN, *xco+width-50+18, *yco, 16, 18, NULL, 0.0, 0.0, 0.0, 0.0, "Move constraint down in constraint stack");
+				uiBlockSetEmboss(block, UI_EMBOSS);
+			}
 		uiBlockEndAlign(block);
 		
 		





More information about the Bf-blender-cvs mailing list