Fix misalignment of menu items in Preferences > Save & Load menu

Checking for the layout alignment is not a reliable way to filter out
which items need the additional icon/text offset. Instead check if the
buttons are icon-only (which we rarely do, e.g. for collection colors in
the Outliner context menu).
This commit is contained in:
2020-09-18 20:58:14 +02:00
parent 9ce1a04e2a
commit a13b14b67d

View File

@@ -2383,7 +2383,8 @@ static void widget_draw_text_icon(const uiFontStyle *fstyle,
rect->xmin += 0.3f * U.widget_unit;
}
}
else if (ui_block_is_menu(but->block) && but->alignnr == 0) {
/* Menu items, but only if they are not icon-only (rare). */
else if (ui_block_is_menu(but->block) && but->drawstr[0]) {
rect->xmin += 0.2f * U.widget_unit;
}