diff options
author | Julian Eisel <eiseljulian@gmail.com> | 2018-07-06 20:26:12 +0300 |
---|---|---|
committer | Julian Eisel <eiseljulian@gmail.com> | 2018-07-06 20:33:13 +0300 |
commit | 29b8adec61b2c88a07d29b78b26aeca26658a166 (patch) | |
tree | 145479afe7116421b2128ec151dc160b21991528 /source/blender/editors/interface/interface_region_popup.c | |
parent | 2a199f5093cf6dc537047f9456adffa52b6aa005 (diff) |
UI: Add extra padding to menus to draw sub-menu triangles in
Shortcut strings would be offset to the left to make space for the triangles,
breaking the alignment with other shortcut strings. Now this alignment is kept
by making menus slightly wider if there's a sub-menu triangle visible, making
room for the triangle.
Diffstat (limited to 'source/blender/editors/interface/interface_region_popup.c')
-rw-r--r-- | source/blender/editors/interface/interface_region_popup.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/source/blender/editors/interface/interface_region_popup.c b/source/blender/editors/interface/interface_region_popup.c index 320ee1f4616..1bbf2242c5d 100644 --- a/source/blender/editors/interface/interface_region_popup.c +++ b/source/blender/editors/interface/interface_region_popup.c @@ -116,6 +116,9 @@ static void ui_popup_block_position(wmWindow *window, ARegion *butregion, uiBut BLI_rctf_init_minmax(&block->rect); for (uiBut *bt = block->buttons.first; bt; bt = bt->next) { + if (block->content_hints & BLOCK_CONTAINS_SUBMENU_BUT) { + bt->rect.xmax += UI_MENU_SUBMENU_PADDING; + } BLI_rctf_union(&block->rect, &bt->rect); } } |