diff options
author | Harley Acheson <harley> | 2018-12-27 14:48:00 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-12-27 14:49:35 +0300 |
commit | e07b58537c05b4370cd0773cc1d63084e4c4a20a (patch) | |
tree | ad7c83e20f0cad86704abf4977374e4cfa991f0b | |
parent | 097b9019ceea7e0c9ef399b548dc917b8525c02e (diff) |
UI: fix inconsistent icon button widths for popovers and enums.
Differential Revision: https://developer.blender.org/D4086
-rw-r--r-- | source/blender/editors/interface/interface_layout.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c index 9b145fdba92..87927ef7643 100644 --- a/source/blender/editors/interface/interface_layout.c +++ b/source/blender/editors/interface/interface_layout.c @@ -2228,7 +2228,7 @@ static uiBut *ui_item_menu( /* pass */ } else if (force_menu) { - w += UI_UNIT_X; + w += 0.6f * UI_UNIT_X; } else { if (name[0]) { @@ -2237,12 +2237,16 @@ static uiBut *ui_item_menu( } } - if (name[0] && icon) + if (name[0] && icon) { but = uiDefIconTextMenuBut(block, func, arg, icon, name, 0, 0, w, h, tip); - else if (icon) + } + else if (icon) { but = uiDefIconMenuBut(block, func, arg, icon, 0, 0, w, h, tip); - else + UI_but_drawflag_enable(but, UI_BUT_ICON_LEFT); + } + else { but = uiDefMenuBut(block, func, arg, name, 0, 0, w, h, tip); + } if (argN) { /* ugly .. */ |