Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam Reynish <william@reynish.com>2010-01-12 15:08:23 +0300
committerWilliam Reynish <william@reynish.com>2010-01-12 15:08:23 +0300
commit6329f7b063057b3617810677e2175d5b8af30bc1 (patch)
treebef6bb39149f4294b268eeb7e467658583d3286d /source/blender/editors/interface/interface_templates.c
parentb01166428415cf7cf55404f10fe55b3e5d46269d (diff)
Made the color ramp template more compact, and made the position field an RNA item.
Diffstat (limited to 'source/blender/editors/interface/interface_templates.c')
-rw-r--r--source/blender/editors/interface/interface_templates.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c
index 0cb916d7448..106875e3907 100644
--- a/source/blender/editors/interface/interface_templates.c
+++ b/source/blender/editors/interface/interface_templates.c
@@ -1428,6 +1428,7 @@ static void colorband_buttons_large(uiLayout *layout, uiBlock *block, ColorBand
{
uiBut *bt;
+ uiLayout *row;
if(coba==NULL) return;
@@ -1453,10 +1454,9 @@ static void colorband_buttons_large(uiLayout *layout, uiBlock *block, ColorBand
/* 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 @@ static void colorband_buttons_small(uiLayout *layout, uiBlock *block, ColorBand
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;