[Bf-blender-cvs] [029a7bb] master: UI: Fix for icon-only menus too small click-able area

Campbell Barton noreply at git.blender.org
Mon Jan 27 09:13:16 CET 2014


Commit: 029a7bbade920385a4852484cc19b138be8a9558
Author: Campbell Barton
Date:   Mon Jan 27 19:10:53 2014 +1100
https://developer.blender.org/rB029a7bbade920385a4852484cc19b138be8a9558

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

===================================================================

M	release/scripts/modules/bpy_types.py
M	source/blender/editors/interface/interface_layout.c

===================================================================

diff --git a/release/scripts/modules/bpy_types.py b/release/scripts/modules/bpy_types.py
index 0b9893c..031d079 100644
--- a/release/scripts/modules/bpy_types.py
+++ b/release/scripts/modules/bpy_types.py
@@ -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):
diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c
index 34c124b..d209933 100644
--- a/source/blender/editors/interface/interface_layout.c
+++ b/source/blender/editors/interface/interface_layout.c
@@ -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)




More information about the Bf-blender-cvs mailing list