This patch makes no real current changes. It merely allows us to do something new without affecting any existing features.
The first part of this is a correction of an error when we determine the width of an interface item. In "ui_text_icon_width" (interface_layout.c 283), there is a test to see if the item has an icon but no name. If that is the case it returns our minimum button width (unit_x). If that test is not passed then we measure the width of the name text and add some padding.
However, this does not handle the case where there is no icon and there is no name. In that case we measure empty string and add padding, etc. When the name is blank we should also be returning unit_x, rather than allow for a blank space that is wider than necessary.
The second part of this fixes the position of the down arrow for menus that have such blank names. If the button/menu has blank name text then the down arrow should be centered, rather than aligned to the right.
As mentioned, this patch does not make a difference for anything that we do currently.
But imagine that we change "space_view3d.py" so that some elements on the header have blank text. We might want to do so if there are other nearby icons that make the text redundant. Or we might want to conditionally blank out the text as the width of the editor decreases, freeing space and decreasing the need for horizontal scrolling.
The image below illustrates this. The top part show how it looks now if we were to set the Overlays and Shading popovers to have blank text. The blank part is wider than required and the down arrow is aligned badly. The bottom shows what it looks like if we do the same thing after the patch is applied, showing the nicer button width and down arrow alignment.
But to reiterate, this patch merely makes the interface look nicer if someone were to choose to have an interface item with no icon and no name.
