[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [25924] trunk/blender/source/blender/ editors/interface/interface_templates.c: Made the color ramp template more compact, and made the position field an RNA item.
William Reynish
william at reynish.com
Tue Jan 12 13:08:23 CET 2010
Revision: 25924
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=25924
Author: billrey
Date: 2010-01-12 13:08:23 +0100 (Tue, 12 Jan 2010)
Log Message:
-----------
Made the color ramp template more compact, and made the position field an RNA item.
Modified Paths:
--------------
trunk/blender/source/blender/editors/interface/interface_templates.c
Modified: trunk/blender/source/blender/editors/interface/interface_templates.c
===================================================================
--- trunk/blender/source/blender/editors/interface/interface_templates.c 2010-01-12 11:21:42 UTC (rev 25923)
+++ trunk/blender/source/blender/editors/interface/interface_templates.c 2010-01-12 12:08:23 UTC (rev 25924)
@@ -1428,6 +1428,7 @@
{
uiBut *bt;
+ uiLayout *row;
if(coba==NULL) return;
@@ -1453,10 +1454,9 @@
/* better to use rna so we can animate them */
PointerRNA ptr;
RNA_pointer_create(cb->ptr.id.data, &RNA_ColorRampElement, cbd, &ptr);
- uiItemR(layout, NULL, 0, &ptr, "color", 0);
- //uiItemR(layout, NULL, 0, &ptr, "position", 0);
- bt= uiDefButF(block, NUM, 0, "Pos:", 0+xoffs,40+yoffs,100, 20, &cbd->pos, 0.0, 1.0, 10, 0, "The position of the active color stop");
- uiButSetNFunc(bt, colorband_pos_cb, MEM_dupallocN(cb), coba);
+ row= uiLayoutRow(layout, 0);
+ uiItemR(row, "Pos", 0, &ptr, "position", 0);
+ uiItemR(row, "", 0, &ptr, "color", 0);
}
}
@@ -1467,11 +1467,12 @@
float unit= (butr->xmax-butr->xmin)/14.0f;
float xs= butr->xmin;
-
+ uiBlockBeginAlign(block);
bt= uiDefBut(block, BUT, 0, "Add", xs,butr->ymin+20.0f,2.0f*unit,20, NULL, 0, 0, 0, 0, "Add a new color stop to the colorband");
uiButSetNFunc(bt, colorband_add_cb, MEM_dupallocN(cb), coba);
bt= uiDefBut(block, BUT, 0, "Delete", xs+2.0f*unit,butr->ymin+20.0f,2.0f*unit,20, NULL, 0, 0, 0, 0, "Delete the active position");
uiButSetNFunc(bt, colorband_del_cb, MEM_dupallocN(cb), coba);
+ uiBlockEndAlign(block);
if(coba->tot) {
CBData *cbd= coba->data + coba->cur;
More information about the Bf-blender-cvs
mailing list