From b9bf4700b07ca3d681664058b232650aea690261 Mon Sep 17 00:00:00 2001 From: Julian Eisel Date: Wed, 15 Feb 2023 15:55:07 +0100 Subject: [PATCH] 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. --- source/blender/editors/interface/interface.cc | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/source/blender/editors/interface/interface.cc b/source/blender/editors/interface/interface.cc index aa5e870623d..6da7576d513 100644 --- a/source/blender/editors/interface/interface.cc +++ b/source/blender/editors/interface/interface.cc @@ -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) {