Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/interface/interface.cc
| Show First 20 Lines • Show All 92 Lines • ▼ Show 20 Lines | |||||
| but->drawflag &= ~UI_BUT_ICON_LEFT; | but->drawflag &= ~UI_BUT_ICON_LEFT; | ||||
| } | } | ||||
| static void ui_def_but_rna__menu(bContext * /*C*/, uiLayout *layout, void *but_p) | static void ui_def_but_rna__menu(bContext * /*C*/, uiLayout *layout, void *but_p) | ||||
| { | { | ||||
| uiBlock *block = uiLayoutGetBlock(layout); | uiBlock *block = uiLayoutGetBlock(layout); | ||||
| uiPopupBlockHandle *handle = block->handle; | uiPopupBlockHandle *handle = block->handle; | ||||
| uiBut *but = (uiBut *)but_p; | uiBut *but = (uiBut *)but_p; | ||||
| int current_value = RNA_property_enum_get(&but->rnapoin, but->rnaprop); | |||||
| /* see comment in ui_item_enum_expand, re: `uiname`. */ | /* see comment in ui_item_enum_expand, re: `uiname`. */ | ||||
| const EnumPropertyItem *item_array; | const EnumPropertyItem *item_array; | ||||
| UI_block_flag_enable(block, UI_BLOCK_MOVEMOUSE_QUIT); | UI_block_flag_enable(block, UI_BLOCK_MOVEMOUSE_QUIT); | ||||
| bool free; | bool free; | ||||
| RNA_property_enum_items_gettexted(static_cast<bContext *>(block->evil_C), | RNA_property_enum_items_gettexted(static_cast<bContext *>(block->evil_C), | ||||
| ▲ Show 20 Lines • Show All 119 Lines • ▼ Show 20 Lines | |||||
| 0, | 0, | ||||
| 0, | 0, | ||||
| ""); | ""); | ||||
| } | } | ||||
| } | } | ||||
| uiItemS(column); | uiItemS(column); | ||||
| } | } | ||||
| else { | else { | ||||
| uiBut *item_but; | |||||
| if (item->icon) { | if (item->icon) { | ||||
| uiDefIconTextButI(block, | item_but = uiDefIconTextButI(block, | ||||
| UI_BTYPE_BUT_MENU, | UI_BTYPE_BUT_MENU, | ||||
| B_NOP, | B_NOP, | ||||
| item->icon, | item->icon, | ||||
| item->name, | item->name, | ||||
| 0, | 0, | ||||
| 0, | 0, | ||||
| UI_UNIT_X * 5, | UI_UNIT_X * 5, | ||||
| UI_UNIT_Y, | UI_UNIT_Y, | ||||
| &handle->retvalue, | &handle->retvalue, | ||||
| item->value, | item->value, | ||||
| 0.0, | 0.0, | ||||
| 0, | 0, | ||||
| -1, | -1, | ||||
| item->description); | item->description); | ||||
| } | } | ||||
| else { | else { | ||||
| uiDefButI(block, | item_but = uiDefButI(block, | ||||
| UI_BTYPE_BUT_MENU, | UI_BTYPE_BUT_MENU, | ||||
| B_NOP, | B_NOP, | ||||
| item->name, | item->name, | ||||
| 0, | 0, | ||||
| 0, | 0, | ||||
| UI_UNIT_X * 5, | UI_UNIT_X * 5, | ||||
| UI_UNIT_X, | UI_UNIT_X, | ||||
| &handle->retvalue, | &handle->retvalue, | ||||
| item->value, | item->value, | ||||
| 0.0, | 0.0, | ||||
| 0, | 0, | ||||
| -1, | -1, | ||||
| item->description); | item->description); | ||||
| } | |||||
| item_but->flag |= UI_BUT_LIST_ITEM; | |||||
| if (item->value == current_value) { | |||||
| item_but->flag |= UI_BUT_ACTIVE_DEFAULT; | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| if (title[0] && (categories == 0) && !(block->flag & UI_BLOCK_NO_FLIP)) { | if (title[0] && (categories == 0) && !(block->flag & UI_BLOCK_NO_FLIP)) { | ||||
| /* Title at the bottom for menus without categories. */ | /* Title at the bottom for menus without categories. */ | ||||
| uiItemS(layout); | uiItemS(layout); | ||||
| uiDefBut(block, | uiDefBut(block, | ||||
| ▲ Show 20 Lines • Show All 92 Lines • Show Last 20 Lines | |||||