Merged changes in the trunk up to revision 43881.
[blender.git] / source / blender / editors / interface / interface_templates.c
index 4a8fba530b0501d96750bd9a38f958a2e43b0d72..9eefb469146a860b921e23be2d31b36ea8885e83 100644 (file)
@@ -1306,6 +1306,16 @@ static void colorband_flip_cb(bContext *C, void *cb_v, void *coba_v)
        rna_update_cb(C, cb_v, NULL);
 }
 
+static void colorband_update_cb(bContext *UNUSED(C), void *bt_v, void *coba_v)
+{
+       uiBut *bt= bt_v;
+       ColorBand *coba= coba_v;
+
+       /* sneaky update here, we need to sort the colorband points to be in order,
+          however the RNA pointer then is wrong, so we update it */
+       colorband_update_sort(coba);
+       bt->rnapoin.data = coba->data + coba->cur;
+}
 
 /* offset aligns from bottom, standard width 300, height 115 */
 static void colorband_buttons_large(uiLayout *layout, uiBlock *block, ColorBand *coba, int xoffs, int yoffs, RNAUpdateCb *cb)
@@ -1349,7 +1359,11 @@ static void colorband_buttons_large(uiLayout *layout, uiBlock *block, ColorBand
                PointerRNA ptr;
                RNA_pointer_create(cb->ptr.id.data, &RNA_ColorRampElement, cbd, &ptr);
                row= uiLayoutRow(layout, 0);
+
                uiItemR(row, &ptr, "position", 0, "Pos", ICON_NONE);
+               bt= block->buttons.last;
+               uiButSetFunc(bt, colorband_update_cb, bt, coba);
+
                uiItemR(row, &ptr, "color", 0, "", ICON_NONE);
        }
 
@@ -2151,7 +2165,7 @@ static void list_item_row(bContext *C, uiLayout *layout, PointerRNA *ptr, Pointe
                Object *ob= (Object*)activeptr->data;
                Key *key= (Key*)itemptr->id.data;
 
-               split= uiLayoutSplit(sub, 0.75f, 0);
+               split= uiLayoutSplit(sub, 0.66f, 0);
 
                uiItemL(split, name, icon);
 
@@ -2159,10 +2173,13 @@ static void list_item_row(bContext *C, uiLayout *layout, PointerRNA *ptr, Pointe
                row= uiLayoutRow(split, 1);
                if(i == 0 || (key->type != KEY_RELATIVE)) uiItemL(row, "", ICON_NONE);
                else uiItemR(row, itemptr, "value", 0, "", ICON_NONE);
+               uiItemR(row, itemptr, "mute", 0, "", 0);
 
-               if(ob->mode == OB_MODE_EDIT && !((ob->shapeflag & OB_SHAPE_EDIT_MODE) && ob->type == OB_MESH))
+               if( (key->flag & KEYBLOCK_MUTE) ||
+                   (ob->mode == OB_MODE_EDIT && !((ob->shapeflag & OB_SHAPE_EDIT_MODE) && ob->type == OB_MESH)) )
+               {
                        uiLayoutSetActive(row, 0);
-               //uiItemR(row, itemptr, "mute", 0, "", ICON_MUTE_IPO_OFF);
+               }
                uiBlockSetEmboss(block, UI_EMBOSS);
        }
        else if(itemptr->type == &RNA_VertexGroup) {