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
path: root/source
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2014-02-09 23:52:57 +0400
committerCampbell Barton <ideasman42@gmail.com>2014-02-10 06:04:43 +0400
commit21b60ea7e16c825a05eab910d13337dd079b8bbf (patch)
tree7c73564c93667a56710987f5e89637e99b3a0439 /source
parenta84bcea070a81b9729ada289bd15e1d86881aa70 (diff)
UI: use RNA for colorband interpolation menu
Diffstat (limited to 'source')
-rw-r--r--source/blender/editors/interface/interface_templates.c10
-rw-r--r--source/blender/makesrna/intern/rna_color.c2
2 files changed, 6 insertions, 6 deletions
diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c
index 35733eb7783..e11055fe278 100644
--- a/source/blender/editors/interface/interface_templates.c
+++ b/source/blender/editors/interface/interface_templates.c
@@ -1470,6 +1470,9 @@ static void colorband_buttons_layout(uiLayout *layout, uiBlock *block, ColorBand
float unit = BLI_rctf_size_x(butr) / 14.0f;
float xs = butr->xmin;
float ys = butr->ymin;
+ PointerRNA ptr;
+
+ RNA_pointer_create(cb->ptr.id.data, &RNA_ColorRamp, coba, &ptr);
split = uiLayoutSplit(layout, 0.4f, false);
@@ -1493,10 +1496,8 @@ static void colorband_buttons_layout(uiLayout *layout, uiBlock *block, ColorBand
uiBlockSetEmboss(block, UI_EMBOSS);
row = uiLayoutRow(split, false);
- bt = uiDefButS(block, MENU, 0, IFACE_("Interpolation %t|Ease %x1|Cardinal %x3|Linear %x0|B-Spline %x2|Constant %x4"),
- 0, ys + UI_UNIT_Y, 8.0f * unit, UI_UNIT_Y, &coba->ipotype, 0.0, 0.0, 0, 0,
- TIP_("Set interpolation between color stops"));
- uiButSetNFunc(bt, rna_update_cb, MEM_dupallocN(cb), NULL);
+
+ uiItemR(row, &ptr, "interpolation", 0, "", ICON_NONE);
row = uiLayoutRow(layout, false);
@@ -1507,7 +1508,6 @@ static void colorband_buttons_layout(uiLayout *layout, uiBlock *block, ColorBand
if (coba->tot) {
CBData *cbd = coba->data + coba->cur;
- PointerRNA ptr;
RNA_pointer_create(cb->ptr.id.data, &RNA_ColorRampElement, cbd, &ptr);
diff --git a/source/blender/makesrna/intern/rna_color.c b/source/blender/makesrna/intern/rna_color.c
index cfbf0193649..408f99bd96a 100644
--- a/source/blender/makesrna/intern/rna_color.c
+++ b/source/blender/makesrna/intern/rna_color.c
@@ -901,7 +901,7 @@ static void rna_def_color_ramp(BlenderRNA *brna)
prop = RNA_def_property(srna, "interpolation", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "ipotype");
RNA_def_property_enum_items(prop, prop_interpolation_items);
- RNA_def_property_ui_text(prop, "Interpolation", "");
+ RNA_def_property_ui_text(prop, "Interpolation", "Set interpolation between color stops");
RNA_def_property_update(prop, 0, "rna_ColorRamp_update");
#if 0 /* use len(elements) */