diff options
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/editors/interface/interface_regions.c | 9 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_ID.c | 2 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_internal.h | 2 |
3 files changed, 10 insertions, 3 deletions
diff --git a/source/blender/editors/interface/interface_regions.c b/source/blender/editors/interface/interface_regions.c index c898ba983c7..d29e5975afb 100644 --- a/source/blender/editors/interface/interface_regions.c +++ b/source/blender/editors/interface/interface_regions.c @@ -2308,7 +2308,6 @@ uiPopupBlockHandle *ui_popup_menu_create(bContext *C, ARegion *butregion, uiBut uiStyle *style= UI_GetStyle(); uiPopupBlockHandle *handle; uiPopupMenu *pup; - pup= MEM_callocN(sizeof(uiPopupMenu), "menu dummy"); pup->block= uiBeginBlock(C, NULL, "ui_button_menu_create", UI_EMBOSSP); pup->layout= uiBlockLayout(pup->block, UI_LAYOUT_VERTICAL, UI_LAYOUT_MENU, 0, 0, 200, 0, style); @@ -2323,6 +2322,14 @@ uiPopupBlockHandle *ui_popup_menu_create(bContext *C, ARegion *butregion, uiBut pup->popup= 1; pup->block->flag |= UI_BLOCK_NO_FLIP; } + else { + /* if this is an rna button then we can assume its an enum + * flipping enums is generally not good since the order can be + * important [#28786] */ + if(but->rnaprop && RNA_property_type(but->rnaprop) == PROP_ENUM) { + pup->block->flag |= UI_BLOCK_NO_FLIP; + } + } if(str) { /* menu is created from a string */ diff --git a/source/blender/makesrna/intern/rna_ID.c b/source/blender/makesrna/intern/rna_ID.c index 3f8a310285e..ddd0fcc1007 100644 --- a/source/blender/makesrna/intern/rna_ID.c +++ b/source/blender/makesrna/intern/rna_ID.c @@ -314,7 +314,7 @@ static int rna_IDPArray_length(PointerRNA *ptr) return prop->len; } -int rna_IDMaterials_assign_int(PointerRNA *ptr, int key, PointerRNA *assign_ptr) +int rna_IDMaterials_assign_int(PointerRNA *ptr, int key, const PointerRNA *assign_ptr) { ID *id= ptr->id.data; Material *mat_id= assign_ptr->id.data; diff --git a/source/blender/makesrna/intern/rna_internal.h b/source/blender/makesrna/intern/rna_internal.h index aab74056ad9..4cd4a2f11f9 100644 --- a/source/blender/makesrna/intern/rna_internal.h +++ b/source/blender/makesrna/intern/rna_internal.h @@ -383,7 +383,7 @@ struct MTex *rna_mtex_texture_slots_create(struct ID *self, struct bContext *C, void rna_mtex_texture_slots_clear(struct ID *self, struct bContext *C, struct ReportList *reports, int index); -int rna_IDMaterials_assign_int(struct PointerRNA *ptr, int key, struct PointerRNA *assign_ptr); +int rna_IDMaterials_assign_int(struct PointerRNA *ptr, int key, const struct PointerRNA *assign_ptr); #endif /* RNA_INTERNAL_H */ |