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
2 changed files with 7 additions and 5 deletions

@ -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):

@ -1619,11 +1619,15 @@ 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
}
else {
if (name[0]) {
w -= UI_UNIT_Y / 2;
}
}
}
if (name[0] && icon)
but = uiDefIconTextMenuBut(block, func, arg, icon, name, 0, 0, w, h, tip);