diff options
author | Ines Almeida <britalmeida@gmail.com> | 2015-04-29 18:22:04 +0300 |
---|---|---|
committer | Ines Almeida <britalmeida@gmail.com> | 2015-04-29 18:29:03 +0300 |
commit | 611bbc696afe58d2ab1b92c2a7578233606aefab (patch) | |
tree | 4a692d5dd844fc2e7e7fec37cecbd8e40ad69c12 /source | |
parent | 78956b6a83f2b5b3011fcfee7715b563c4c8b1bd (diff) |
cleanup for uiTemplateIconView
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/interface/interface_templates.c | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c index d333ab9f4c1..66de859b453 100644 --- a/source/blender/editors/interface/interface_templates.c +++ b/source/blender/editors/interface/interface_templates.c @@ -1641,10 +1641,7 @@ static uiBlock *ui_icon_view_menu_cb(bContext *C, ARegion *ar, void *arg_litem) /* arg_litem is malloced, can be freed by parent button */ cb = *((RNAUpdateCb *)arg_litem); - - /* unused */ - // icon = RNA_property_enum_get(&cb.ptr, cb.prop); - + block = UI_block_begin(C, ar, "_popup", UI_EMBOSS); UI_block_flag_enable(block, UI_BLOCK_LOOP); @@ -1682,12 +1679,13 @@ void uiTemplateIconView(uiLayout *layout, PointerRNA *ptr, const char *propname) EnumPropertyItem *items; uiBlock *block; uiBut *but; -// rctf rect; /* UNUSED */ int value, icon = ICON_NONE, tot_items; bool free_items; - - if (!prop || RNA_property_type(prop) != PROP_ENUM) + + if (!prop || RNA_property_type(prop) != PROP_ENUM) { + RNA_warning("property of type Enum not found: %s.%s", RNA_struct_identifier(ptr->type), propname); return; + } block = uiLayoutAbsoluteBlock(layout); @@ -1698,15 +1696,9 @@ void uiTemplateIconView(uiLayout *layout, PointerRNA *ptr, const char *propname) cb = MEM_callocN(sizeof(RNAUpdateCb), "RNAUpdateCb"); cb->ptr = *ptr; cb->prop = prop; - -// rect.xmin = 0; rect.xmax = 10.0f * UI_UNIT_X; -// rect.ymin = 0; rect.ymax = 10.0f * UI_UNIT_X; - + but = uiDefBlockButN(block, ui_icon_view_menu_cb, MEM_dupallocN(cb), "", 0, 0, UI_UNIT_X * 6, UI_UNIT_Y * 6, ""); - -// but = uiDefIconButR_prop(block, UI_BTYPE_ROW, 0, icon, 0, 0, BLI_rctf_size_x(&rect), BLI_rctf_size_y(&rect), ptr, prop, -1, 0, icon, -1, -1, NULL); - but->icon = icon; UI_but_flag_enable(but, UI_HAS_ICON | UI_BUT_ICON_PREVIEW); |