Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/editors/interface/interface_layout.c')
-rw-r--r--source/blender/editors/interface/interface_layout.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c
index 8b9539f1d33..03c67e9b046 100644
--- a/source/blender/editors/interface/interface_layout.c
+++ b/source/blender/editors/interface/interface_layout.c
@@ -2911,6 +2911,12 @@ static uiBut *ui_item_menu(uiLayout *layout,
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) {
name = CTX_IFACE_(mt->translation_context, mt->label);
}
@@ -2949,6 +2955,9 @@ void uiItemMContents(uiLayout *layout, const char *menuname)
uiBlock *block = layout->root->block;
bContext *C = block->evil_C;
+ if (WM_menutype_poll(C, mt) == false) {
+ return;
+ }
UI_menutype_draw(C, mt, layout);
}
@@ -5956,8 +5965,8 @@ uiLayout *uiItemsAlertBox(uiBlock *block, const int size, const eAlertIcon icon)
const int text_points_max = MAX2(style->widget.points, style->widgetlabel.points);
const int dialog_width = icon_size + (text_points_max * size * U.dpi_fac);
/* By default, the space between icon and text/buttons will be equal to the 'columnspace',
- this extra padding will add some space by increasing the left column width,
- making the icon placement more symmetrical, between the block edge and the text. */
+ * this extra padding will add some space by increasing the left column width,
+ * making the icon placement more symmetrical, between the block edge and the text. */
const float icon_padding = 5.0f * U.dpi_fac;
/* Calculate the factor of the fixed icon column depending on the block width. */
const float split_factor = ((float)icon_size + icon_padding) /