UI: Fix for icon-only menus too small click-able area
authorCampbell Barton <ideasman42@gmail.com>
Mon, 27 Jan 2014 08:10:53 +0000 (19:10 +1100)
committerCampbell Barton <ideasman42@gmail.com>
Mon, 27 Jan 2014 08:11:37 +0000 (19:11 +1100)
release/scripts/modules/bpy_types.py
source/blender/editors/interface/interface_layout.c

index 0b9893cea514e00098ca43c39660c42318270cbb..031d079e5dcf119108bec26d781d43dd9ce0275b 100644 (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):
index 34c124b293ed5bc06bf172d04b9c3d73f69b78c4..d2099334efbc8e992c28de7acff9a50aae0029c6 100644 (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)