[Bf-blender-cvs] [686b8e8fedd] blender-v2.79-release: Fix width estimation for buttons with short labels in pie menus

Aleksandr Zinovev noreply at git.blender.org
Thu Aug 17 14:45:21 CEST 2017


Commit: 686b8e8fedde898375382fdc0a4596c222752feb
Author: Aleksandr Zinovev
Date:   Sat Aug 12 11:00:19 2017 +0300
Branches: blender-v2.79-release
https://developer.blender.org/rB686b8e8fedde898375382fdc0a4596c222752feb

Fix width estimation for buttons with short labels in pie menus

Differential Revision: https://developer.blender.org/D2781

To be backported to 2.79 branch

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

M	source/blender/editors/interface/interface_layout.c

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

diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c
index b4de3d0c5ef..a95fe59348d 100644
--- a/source/blender/editors/interface/interface_layout.c
+++ b/source/blender/editors/interface/interface_layout.c
@@ -3406,8 +3406,9 @@ void ui_layout_add_but(uiLayout *layout, uiBut *but)
 	ui_item_size((uiItem *)bitem, &w, &h);
 	/* XXX uiBut hasn't scaled yet
 	 * we can flag the button as not expandable, depending on its size */
-	if (w <= 2 * UI_UNIT_X)
+	if (w <= 2 * UI_UNIT_X && (!but->str || but->str[0] == '\0')) {
 		bitem->item.flag |= UI_ITEM_MIN;
+	}
 
 	BLI_addtail(&layout->items, bitem);




More information about the Bf-blender-cvs mailing list