Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/interface/interface.c
| Context not available. | |||||
| 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; | ||||
| bool show_title = true; | |||||
| /* see comment in ui_item_enum_expand, re: uiname */ | /* see comment in ui_item_enum_expand, re: uiname */ | ||||
| const EnumPropertyItem *item, *item_array; | const EnumPropertyItem *item, *item_array; | ||||
| Context not available. | |||||
| /* inconsistent, but menus with categories do not look good flipped */ | /* inconsistent, but menus with categories do not look good flipped */ | ||||
| if (item->name) { | if (item->name) { | ||||
| block->flag |= UI_BLOCK_NO_FLIP; | block->flag |= UI_BLOCK_NO_FLIP; | ||||
| show_title = false; | |||||
| nbr_entries_nosepr++; | nbr_entries_nosepr++; | ||||
| } | } | ||||
| /* We do not want simple separators in nbr_entries_nosepr count */ | /* We do not want simple separators in nbr_entries_nosepr count */ | ||||
| Context not available. | |||||
| rows++; | rows++; | ||||
| } | } | ||||
| if (block->flag & UI_BLOCK_NO_FLIP) { | char *title = RNA_property_ui_name(but->rnaprop); | ||||
| if (block->flag & UI_BLOCK_NO_FLIP && show_title && title[0]) { | |||||
| /* Title at the top for menus with categories. */ | /* Title at the top for menus with categories. */ | ||||
| uiDefBut(block, | uiDefBut(block, | ||||
| UI_BTYPE_LABEL, | UI_BTYPE_LABEL, | ||||
| Context not available. | |||||
| 0, | 0, | ||||
| ""); | ""); | ||||
| } | } | ||||
| } | |||||
| else { | |||||
| uiItemS(column); | uiItemS(column); | ||||
| } | } | ||||
| } | } | ||||
| Context not available. | |||||
| } | } | ||||
| } | } | ||||
| if (!(block->flag & UI_BLOCK_NO_FLIP)) { | if (!(block->flag & UI_BLOCK_NO_FLIP) && show_title && title[0]) { | ||||
| /* Title at the bottom for menus without categories. */ | /* Title at the bottom for menus without categories. */ | ||||
| uiItemS(layout); | uiItemS(layout); | ||||
| uiDefBut(block, | uiDefBut(block, | ||||
| Context not available. | |||||
angavrilov: Is it intentional that menus without named categories completely lose the capability to have… | |||||
Not Done Inline ActionsI would recommend an explicit comparison to 0 here so it's clear the variable is an int. HooglyBoogly: I would recommend an explicit comparison to 0 here so it's clear the variable is an int. | |||||
Is it intentional that menus without named categories completely lose the capability to have simple separators?