Fix weird icon padding in asset library selector menu button
Since the menu doesn't automatically align the labels like other menus and pulldowns in Blender, I manually made them align using the blank icon. However the menu button would also include this blank icon now. This is a specific fix for the 3.5 release. In the main branch I will replace it with proper support for automatically aligning labels in such menus.
This commit is contained in:
@@ -4585,7 +4585,15 @@ static uiBut *ui_def_but_rna(uiBlock *block,
|
||||
#endif
|
||||
}
|
||||
|
||||
icon = item[i].icon;
|
||||
/* #ICON_BLANK1 can be used to add padding of the size of an icon. This is fine to align
|
||||
* multiple items within a menu, but not for the menu button that only shows the label then.
|
||||
*/
|
||||
if ((type == UI_BTYPE_MENU) && (item[i].icon == ICON_BLANK1)) {
|
||||
icon = ICON_NONE;
|
||||
}
|
||||
else {
|
||||
icon = item[i].icon;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (!str) {
|
||||
|
Reference in New Issue
Block a user