UI: Fix for icon-only menus too small click-able area

This commit is contained in:
Campbell Barton 2014-01-27 19:10:53 +11:00
parent a71f072f9c
commit 029a7bbade
Notes: blender-bot 2023-02-14 11:16:58 +01:00
Referenced by issue #38370, Ubuntu 14.04 opencolorio segfaults blender on parsing colormanagement/config.ocio
2 changed files with 7 additions and 5 deletions

View File

@ -760,9 +760,7 @@ class Menu(StructRNA, _GenericUI, metaclass=RNAMeta):
if context.area.show_menus:
cls.draw_menus(layout, context)
else:
layout.separator()
layout.menu(cls.__name__, icon='COLLAPSEMENU')
layout.separator()
class Region(StructRNA):

View File

@ -1619,10 +1619,14 @@ static void ui_item_menu(uiLayout *layout, const char *name, int icon, uiMenuCre
h = UI_UNIT_Y;
if (layout->root->type == UI_LAYOUT_HEADER) { /* ugly .. */
if (force_menu)
if (force_menu) {
w += UI_UNIT_Y;
else
w -= UI_UNIT_Y / 2;
}
else {
if (name[0]) {
w -= UI_UNIT_Y / 2;
}
}
}
if (name[0] && icon)