Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/interface/interface_layout.c
| Show First 20 Lines • Show All 2,905 Lines • ▼ Show 20 Lines | if (ELEM(layout->root->type, UI_LAYOUT_PANEL, UI_LAYOUT_TOOLBAR) || | ||||
| UI_but_type_set_menu_from_pulldown(but); | UI_but_type_set_menu_from_pulldown(but); | ||||
| } | } | ||||
| return but; | return but; | ||||
| } | } | ||||
| void uiItemM_ptr(uiLayout *layout, MenuType *mt, const char *name, int icon) | void uiItemM_ptr(uiLayout *layout, MenuType *mt, const char *name, int icon) | ||||
| { | { | ||||
| uiBlock *block = layout->root->block; | |||||
| bContext *C = block->evil_C; | |||||
| if (WM_menutype_poll(C, mt) == false) { | |||||
| return; | |||||
| } | |||||
| if (!name) { | if (!name) { | ||||
| name = CTX_IFACE_(mt->translation_context, mt->label); | name = CTX_IFACE_(mt->translation_context, mt->label); | ||||
| } | } | ||||
| if (layout->root->type == UI_LAYOUT_MENU && !icon) { | if (layout->root->type == UI_LAYOUT_MENU && !icon) { | ||||
| icon = ICON_BLANK1; | icon = ICON_BLANK1; | ||||
| } | } | ||||
| Show All 22 Lines | void uiItemMContents(uiLayout *layout, const char *menuname) | ||||
| MenuType *mt = WM_menutype_find(menuname, false); | MenuType *mt = WM_menutype_find(menuname, false); | ||||
| if (mt == NULL) { | if (mt == NULL) { | ||||
| RNA_warning("not found %s", menuname); | RNA_warning("not found %s", menuname); | ||||
| return; | return; | ||||
| } | } | ||||
| uiBlock *block = layout->root->block; | uiBlock *block = layout->root->block; | ||||
| bContext *C = block->evil_C; | bContext *C = block->evil_C; | ||||
| if (WM_menutype_poll(C, mt) == false) { | |||||
| return; | |||||
| } | |||||
| UI_menutype_draw(C, mt, layout); | UI_menutype_draw(C, mt, layout); | ||||
| } | } | ||||
| /** | /** | ||||
| * Insert a decorator item for a button with the same property as \a prop. | * Insert a decorator item for a button with the same property as \a prop. | ||||
| * To force inserting a blank dummy element, NULL can be passed for \a ptr and \a prop. | * To force inserting a blank dummy element, NULL can be passed for \a ptr and \a prop. | ||||
| */ | */ | ||||
| void uiItemDecoratorR_prop(uiLayout *layout, PointerRNA *ptr, PropertyRNA *prop, int index) | void uiItemDecoratorR_prop(uiLayout *layout, PointerRNA *ptr, PropertyRNA *prop, int index) | ||||
| ▲ Show 20 Lines • Show All 3,025 Lines • Show Last 20 Lines | |||||