UI: fix display of menu buttons without text and icon, and only a down arrow.
authorHarley Acheson <harley>
Fri, 4 Jan 2019 14:08:47 +0000 (15:08 +0100)
committerBrecht Van Lommel <brechtvanlommel@gmail.com>
Fri, 4 Jan 2019 14:20:02 +0000 (15:20 +0100)
Differential Revision: https://developer.blender.org/D4123

source/blender/editors/interface/interface_layout.c

index 0c94705..e6c3d96 100644 (file)
@@ -291,6 +291,9 @@ static int ui_text_icon_width(uiLayout *layout, const char *name, int icon, bool
        variable = ui_layout_variable_size(layout);
 
        if (variable) {
+               if (!icon && !name[0]) {
+                       return unit_x; /* No icon or name. */
+               }
                if (layout->alignment != UI_LAYOUT_ALIGN_EXPAND) {
                        layout->item.flag |= UI_ITEM_MIN;
                }