diff options
author | Julian Eisel <julian@blender.org> | 2020-09-18 21:58:14 +0300 |
---|---|---|
committer | Julian Eisel <julian@blender.org> | 2020-09-18 21:59:27 +0300 |
commit | a13b14b67d6f3931792da7eb8a0e04aed1196616 (patch) | |
tree | 79a18e52ba6f7980cc85f17ac0ac73c4d9cd7d17 /source/blender | |
parent | 9ce1a04e2aa19a2746f0947bd8d8391f680cc90d (diff) |
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).
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/editors/interface/interface_widgets.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c index 3d103190a0d..22e57cf8696 100644 --- a/source/blender/editors/interface/interface_widgets.c +++ b/source/blender/editors/interface/interface_widgets.c @@ -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; } |